Skip to content

Commit cd1dea6

Browse files
committed
fix(release): mint the Homebrew tap token from the release-bot App
TAP_GITHUB_TOKEN was created before the org was renamed from Pythoughts-labs to PyModel, so the tap clone succeeds (public repo, token unused for the read) and only the push is refused. That broke the tap bump on 0.17.1 and 0.18.0. The job now mints an installation token from pythinker-release-bot, scoped with owner + repositories to homebrew-tap alone so it carries no write access to pythinker-code. App tokens are minted per run and do not expire, which retires this failure class rather than resetting its clock.
1 parent 0021081 commit cd1dea6

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": patch
3+
---
4+
5+
Use a scoped GitHub App token for Homebrew tap updates.

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,20 @@ jobs:
325325
with:
326326
node-version-file: .nvmrc
327327

328+
- name: Mint tap token
329+
id: tap-token
330+
uses: actions/create-github-app-token@v2
331+
with:
332+
app-id: ${{ vars.RELEASE_BOT_APP_ID }}
333+
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
334+
owner: PyModel
335+
repositories: homebrew-tap
336+
328337
- name: Bump formula
329338
env:
330-
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
339+
TAP_GITHUB_TOKEN: ${{ steps.tap-token.outputs.token }}
331340
run: |
341+
# The token comes from the App installation, not a PAT.
332342
if [ -z "$TAP_GITHUB_TOKEN" ]; then
333343
echo "TAP_GITHUB_TOKEN secret not set — skipping tap update" >&2
334344
exit 0

0 commit comments

Comments
 (0)