fix(ci): grant pull-requests: write so release success step can comment on PRs#145
Conversation
The semantic-release/github success step posts a 'released in version' comment on the merged PR. With only contents+issues write, GitHub denied that write (see run 26256538929: 'Not allowed to add a comment to the issue/PR #144'). Per @semantic-release/github docs, pull-requests: write is required for the success comment.
There was a problem hiding this comment.
Pull request overview
Updates the release workflow’s GITHUB_TOKEN permissions so @semantic-release/github can successfully post “included in release” comments on merged pull requests during the release success step.
Changes:
- Add
pull-requests: writeto.github/workflows/release.ymltop-levelpermissions:.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 2.0.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Summary
Follow-up to #144. The release workflow that just published
slicc-handoff-v1.0.1succeeded at creating the GitHub release, but thesuccessstep of@semantic-release/githubfailed with:(Visible in run 26256538929.) The release artifacts themselves are fine — only the courtesy "this PR is included in version X.Y.Z" comment on the merged PR did not post.
Root cause
.github/workflows/release.ymlgrantedcontents: writeandissues: write, but PR comments go through the pull requests API surface, which requires its own permission. Per the@semantic-release/githubREADME, when usingGITHUB_TOKENall three permissions are required:contents: write— publish a GitHub releaseissues: write— comment on released issuespull-requests: write— comment on released pull requestsThe first two were enough for everything except commenting on the merged PR, which is exactly what failed.
Change
One line added to the top-level
permissions:block. No other changes.Test plan
git diff origin/mainshows exactly one added line.mainproduces a release whosesuccessstep posts a comment on the included PR without error (will be observable in the next "Release Skills" workflow run).Why not retroactively fix the missing comment on #144
@semantic-release/github'ssuccessstep only runs as part of a release. It will not retroactively comment on PRs from past releases; it only comments on PRs included in the current release. So we can't recover the missing comment on #144 — only ensure future releases post their comments correctly.Pull Request opened by Augment Code with guidance from the PR author