ci: pass PAT to action-gh-release so release events propagate #44
Reference in New Issue
Block a user
Delete Branch "fix/release-pat-propagation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
GitHub Actions deliberately does not propagate workflow events triggered by the default
GITHUB_TOKEN— a safety feature against infinite loops. `softprops/action-gh-release` falls back toGITHUB_TOKENwhen notokenis supplied, so the resultingrelease: publishedevent is silently swallowed and never reaches downstream workflows likehomebrew-bump.yml.Reference: GitHub docs — Triggering a workflow from a workflow:
How we found it
Discovered while shipping v0.10.1 (the release that closes #35 + ships #41 #40 #42 #43):
git tag v0.10.1pushedrelease.ymltriggered on tag pushcargo publishto crates.iosoftprops/action-gh-releasecreated the GitHub releasehomebrew-bump.ymlauto-fired onrelease: publishedbrew upgrade numastuck on v0.10.0Had to manually run
gh workflow run homebrew-bump.yml -f version=0.10.1to actually update the tap. Latent bug since #39 landed today.Fix
Pass
HOMEBREW_TAP_GITHUB_TOKENexplicitly tosoftprops/action-gh-release. This secret is already a PAT — it has to be, becausehomebrew-bump.ymluses it togit cloneand push to a different repo (razvandimescu/homebrew-tap), whichGITHUB_TOKENcannot do (no cross-repo scope). Reusing it for release creation keeps the secret surface flat (no second PAT).PAT-authored release events ARE propagated by GitHub Actions — that's the documented escape hatch from the no-propagation rule.
What this affects
Test plan
This is a CI workflow change. The fix can only be exercised end-to-end by cutting an actual release, which we won't do until v0.10.2 ships organically. Static verification:
HOMEBREW_TAP_GITHUB_TOKENsecret already exists in repo (homebrew-bump.yml uses it successfully today)tokenis the documented input for overriding GITHUB_TOKENgh workflow runWhy not a fancier fix
I considered:
repository_dispatchfrom release.yml → homebrew-bump.yml: cleaner separation but requires editing both workflows + adding arepository_dispatchtrigger. More moving parts for the same outcome.release.yml: couples release + tap update into one workflow. Worse for separation of concerns, also still needs the PAT for cross-repo push.The single-line
token:addition is the smallest change with the largest payoff.🤖 Generated with Claude Code