fix: surface pull-requests permission failure instead of silently exiting 0#1165
Open
qozle wants to merge 1 commit intoanthropics:mainfrom
Open
fix: surface pull-requests permission failure instead of silently exiting 0#1165qozle wants to merge 1 commit intoanthropics:mainfrom
qozle wants to merge 1 commit intoanthropics:mainfrom
Conversation
…ting 0
Two compounding bugs that cause code review to silently produce no output.
Bug 1 — wrong permissions in example workflows:
examples/pr-review-filtered-authors.yml and examples/pr-review-filtered-paths.yml
both had `pull-requests: read`. Posting review comments requires `write`.
Users copying these templates would get silent failures with no indication
anything went wrong.
Bug 2 — action exits 0 when Claude can't post review comments:
When Claude calls create_inline_comment and receives a 403, the MCP server
already returns { isError: true }, but Claude still concludes subtype:
"success" because from its perspective it "attempted the task". The action
trusts subtype as the sole success signal and exits 0, showing a green check
while every attempted review comment was silently dropped.
Fix A: add a 403-specific helpMessage in github-inline-comment-server.ts
that tells the user exactly what permission to add. This surfaces the fix
in Claude's response and the action logs.
Fix B: after runClaude() returns "success", scan the execution file for
tool_result items with is_error:true and "Resource not accessible by
integration" (GitHub's canonical error for this permission class). If any
are found, override claudeSuccess=false and call core.setFailed() with an
actionable message including the comment count and the exact YAML to add.
The detection is scoped to the canonical GitHub Apps permission error string
— no ambiguity with other 403 scenarios.
Fixes anthropics#1121
Co-Authored-By: Claude Sonnet 4.6 <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.
Problem
Two compounding bugs that result in the code review action running successfully but silently posting no output anywhere — green check, zero comments, no indication anything went wrong.
Bug 1: Example workflows have wrong permissions
examples/pr-review-filtered-authors.ymlandexamples/pr-review-filtered-paths.ymlboth specify:Posting review comments requires
pull-requests: write. Users copying these templates hit silent failures with no diagnostic.Bug 2: Action exits 0 when Claude can't post comments (403)
When Claude calls
create_inline_commentand receives a 403, the MCP server already returns{ isError: true }. But Claude still concludessubtype: "success"because from its perspective it "attempted the task." The action trustssubtypeas the sole success signal:Result: green check, zero review comments, no feedback.
Fix
Bug 1: Change
pull-requests: read→writein both example files.Bug 2 — two-part fix:
Part A — add a 403-specific
helpMessagetogithub-inline-comment-server.tsso Claude's response includes actionable guidance:Part B — after
runClaude()returns "success", scan the execution file fortool_resultitems withis_error: trueand the text"Resource not accessible by integration"(GitHub's canonical error for this permission class). If any are found, override the conclusion to failure with an actionable message:The string
"Resource not accessible by integration"is unambiguous — it's the specific Octokit error for GitHub Apps integration permission failures, not a general 403. The scan is a no-op when the execution file is absent or contains no such errors.Fixes #1121