fix(tag): use GITHUB_TOKEN, not the release PAT - #192
Merged
Conversation
Run 34238237358 reached `gh release create` and got "HTTP 403: Resource not accessible by personal access token". This workflow preferred RELEASE_TOKEN whenever it was set, which handed a job that never needed the PAT a credential weaker than the one it already had. Run 2 creates a tag and a release; tags are not covered by the branch ruleset, and this workflow already declares permissions: contents: write, so GITHUB_TOKEN is both sufficient and the right token for the job. RELEASE_TOKEN stays in release.yml, where the merge genuinely needs to bypass the ruleset. Narrowing where the PAT is used is the correct direction anyway — it should be reachable by exactly the one step that cannot work without it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Run
34238237358got through every check — sha verified, version matched, bundle present and still signing-verified — then failed at the last step:My design error.
tag.ymlpreferredRELEASE_TOKENwhenever it was set, which handed a job that never needed the PAT a credential weaker than the one it already had. Run 2 creates a tag and a release: tags aren't covered by the branch ruleset, and this workflow already declarespermissions: contents: write, soGITHUB_TOKENis both sufficient and the right token for the job.Now uses
github.tokenfor both checkout andgh, with a comment at the top of the file saying why the PAT is deliberately absent — so nobody "fixes" it back later.On why the PAT was refused: GitHub documents fine-grained Contents-write as covering releases, and this same token pushed a branch and merged a PR in run 1, so I can't fully explain the 403 and I'm not going to pretend otherwise. It doesn't need explaining to be fixed — run 2 shouldn't have been using that token regardless, and narrowing the PAT to the single step that can't work without it is the right shape independent of this bug.
No
1.0.52tag exists, so the failed run left nothing behind. Safe to re-dispatch with the same inputs.🤖 Generated with Claude Code
https://claude.ai/code/session_01Miqsf1M14nY5TKiZHzyjNY