fix(release): grant pull-requests:read so the notes step stops 403ing - #148
Merged
Conversation
The 'Compose release notes' step calls `gh api .../commits/<sha>/pulls` and `.../pulls/<n>`, which need `pull-requests: read`. The workflow only granted `contents: write`, so the default GITHUB_TOKEN got 403 'Resource not accessible by integration'; the error body was then fed back as a fake PR number, producing 'unsupported protocol scheme' and failing the release. - Add `pull-requests: read` to permissions (root cause). - Defense-in-depth: only ever append a bare numeric PR number to the list, and skip any non-numeric entry when fetching — so a future API hiccup can't crash the notes step again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
The failure
The v0.2.0 release run failed at Compose release notes (run):
Root cause
The step reads merged PRs via
gh api .../commits/<sha>/pullsand.../pulls/<n>, which requirepull-requests: read. The workflow only grantedcontents: write, so the defaultGITHUB_TOKENwas denied (403). The 403 error body then got written into the PR-number list and fed back into a URL, producing theunsupported protocol schemecrash.Fix
pull-requests: readtopermissions(the root cause).YAML validated locally. No code paths touched — workflow only.
The failed run's Tag step already pushed
v0.2.0(at the #147 merge commit), but no Release was published (the notes step died first). The workflow's own "tag already exists — immutable" guard will block a re-run until the orphan tag is deleted:Then, after merging this PR, re-run the release workflow (
workflow_dispatch, version0.2.0).🤖 Generated with Claude Code