ci: call homebrew-bump as reusable workflow instead of PAT event propagation #53
Reference in New Issue
Block a user
Delete Branch "ci/release-workflow-call-homebrew-bump"
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
PR #44 swapped
GITHUB_TOKENforHOMEBREW_TAP_GITHUB_TOKENonaction-gh-releaseso that therelease: publishedevent would propagate tohomebrew-bump.yml. The reasoning was correct — GitHub Actions deliberately does not propagate events triggered byGITHUB_TOKEN— but the implementation conflated two unrelated scopes into one token, and that bit us on the v0.10.2 cut.HOMEBREW_TAP_GITHUB_TOKENis a fine-grained PAT scoped only torazvandimescu/homebrew-tap(because that's allhomebrew-bump.ymloriginally needed: clone + push the tap repo). It has zero access torazvandimescu/numa, so whenaction-gh-releasetried to create a release onnuma, GitHub returned:v0.10.2 had to be recovered manually via
gh release createfrom a user PAT. v0.10.0 and v0.10.1 both worked fine — because PR #44 was merged after v0.10.1 was tagged, v0.10.2 was the first release to actually exercise the new code path.Fix
Sidestep the event-propagation rule entirely by invoking
homebrew-bump.ymldirectly as a reusable workflow viaworkflow_call. Each token then does exactly what its scope permits:GITHUB_TOKENcreates the release onnuma(defaultcontents: write)HOMEBREW_TAP_GITHUB_TOKENpushes tohomebrew-tap(unchanged)release.yml
token:override onaction-gh-release→ reverts toGITHUB_TOKENdefault (which v0.10.0 and v0.10.1 used successfully).bump-homebrewjob:homebrew-bump.yml
workflow_calltrigger with aversioninput.release: publishedtrigger — no longer needed since we invoke directly.workflow_dispatchfor manual recovery.inputs.versionread (the branch ongithub.event_nameis gone).Benefits over #44
needs: releaseis a hard dependency;release: publishedwas a soft hope that events would fire.numacontents:write?" confusion.workflow_dispatchtrigger retained forgh workflow run homebrew-bump.yml -f version=x.y.z.Test plan
HOMEBREW_TAP_GITHUB_TOKENscope expansionWhat this affects
GITHUB_TOKENfor release creation, calls homebrew-bump as a reusable workflow for the tap updateHOMEBREW_TAP_GITHUB_TOKENPAT scope: unchanged — still only needs access torazvandimescu/homebrew-tap🤖 Generated with Claude Code