Skip to content

fix(ci): grant pull-requests: write so release success step can comment on PRs#145

Merged
trieloff merged 1 commit into
mainfrom
fix-release-pr-comment-permission
May 21, 2026
Merged

fix(ci): grant pull-requests: write so release success step can comment on PRs#145
trieloff merged 1 commit into
mainfrom
fix-release-pr-comment-permission

Conversation

@trieloff

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #144. The release workflow that just published slicc-handoff-v1.0.1 succeeded at creating the GitHub release, but the success step of @semantic-release/github failed with:

Not allowed to add a comment to the issue/PR #144.

(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.yml granted contents: write and issues: write, but PR comments go through the pull requests API surface, which requires its own permission. Per the @semantic-release/github README, when using GITHUB_TOKEN all three permissions are required:

  • contents: write — publish a GitHub release
  • issues: write — comment on released issues
  • pull-requests: write — comment on released pull requests

The 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.

 permissions:
   contents: write
   issues: write
+  pull-requests: write

Test plan

  • git diff origin/main shows exactly one added line.
  • After merge, the next release-triggering push to main produces a release whose success step 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's success step 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

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.
@trieloff trieloff marked this pull request as ready for review May 21, 2026 22:30
@trieloff trieloff requested a review from shsteimer as a code owner May 21, 2026 22:30
Copilot AI review requested due to automatic review settings May 21, 2026 22:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: write to .github/workflows/release.yml top-level permissions:.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@trieloff trieloff merged commit 706f94d into main May 21, 2026
10 checks passed
@trieloff trieloff deleted the fix-release-pr-comment-permission branch May 21, 2026 22:33
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants