Skip to content

fix(release): grant pull-requests:read so the notes step stops 403ing - #148

Merged
eaitbrahim merged 1 commit into
mainfrom
fix/release-notes-permissions
Jul 24, 2026
Merged

fix(release): grant pull-requests:read so the notes step stops 403ing#148
eaitbrahim merged 1 commit into
mainfrom
fix/release-notes-permissions

Conversation

@eaitbrahim

Copy link
Copy Markdown
Contributor

The failure

The v0.2.0 release run failed at Compose release notes (run):

repos/.../commits/<sha>/pulls → 403 "Resource not accessible by integration"
… then: Get "repos/.../pulls/{"message":"Resource not accessible…}" : unsupported protocol scheme ""

Root cause

The step reads merged PRs via gh api .../commits/<sha>/pulls and .../pulls/<n>, which require pull-requests: read. The workflow only granted contents: write, so the default GITHUB_TOKEN was denied (403). The 403 error body then got written into the PR-number list and fed back into a URL, producing the unsupported protocol scheme crash.

Fix

  • Add pull-requests: read to permissions (the root cause).
  • Defense-in-depth: only append bare numeric PR numbers to the list, and skip any non-numeric entry when fetching — so a future API hiccup can't crash the notes step the same way.

YAML validated locally. No code paths touched — workflow only.

⚠️ Recovery needed before re-running (the tag already exists)

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:

git push origin --delete v0.2.0     # remove the orphan tag (no Release was published)
git tag -d v0.2.0                    # local, if present

Then, after merging this PR, re-run the release workflow (workflow_dispatch, version 0.2.0).

🤖 Generated with Claude Code

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>
@eaitbrahim
eaitbrahim merged commit 9e77a5f into main Jul 24, 2026
1 check passed
@eaitbrahim
eaitbrahim deleted the fix/release-notes-permissions branch July 24, 2026 13:51
@eaitbrahim eaitbrahim added the ci CI/workflows (Docs, CI & tooling) label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/workflows (Docs, CI & tooling)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant