Repository navigation
Fail the step when the job's token can't post the review comment - #229
Open
reuvenharrison wants to merge 2 commits into
Open
reuvenharrison wants to merge 2 commits into
reuvenharrison wants to merge 2 commits into
Conversation
When the job's token lacked pull-requests: write, the review comment failed with only a warning on a passing job, so the comment silently never appeared. The step now fails with an error naming the permission to add, or the opt-out (github-token: ''). A pull request from a fork, where the token is read-only whatever the job grants, still only gets a plain line, and any other refusal (such as a rate limit) still warns. The anonymous delivery event now carries GitHub's HTTP status when the comment fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
These steps check the action's output, not the comment, and the test workflows don't grant pull-requests: write, so a comment attempt would now fail them. Set github-token: '' on each, the opt-out the new error names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
When the job's token lacks
pull-requests: write, GitHub refuses the review comment with HTTP 403 ("Resource not accessible by integration"). Until now the action only printed a warning on a job that still passed, so the comment never appeared and nothing on the pull request said why.The step now fails with an error naming the fix:
Unchanged:
This changes the job result for workflows that run the action without the permission, so it belongs in a minor release with an upgrade note.
The anonymous delivery event now also carries the HTTP status of a failed comment.
The test for a blocked comment now covers the missing permission (step fails, exit 1), a rate-limited 403 (warning, step passes) and a fork (plain line). It fails on the current main.
🤖 Generated with Claude Code