Grant workflows write access so Claude can post PR comments - #3
Merged
Merged
Conversation
The GitHub App scaffold ships both workflows with pull-requests: read and issues: read, so the review runs and analyses the diff but is denied when it tries to post — the job goes green with no comment (permission_denials_count: 1 in the run log). Bump pull-requests and issues to write on both the auto-review and the @claude assistant workflows. Must land on the default branch: claude-code-action refuses to run when the workflow file on a PR branch differs from the default branch, so this only takes effect on PRs opened after it merges to main. Co-Authored-By: Claude Opus 4.8 (1M context) <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
The Claude Code Review workflow succeeds on every PR but posts no comment. The run log shows the review runs and analyses the diff, then hits
"permission_denials_count": 1when it tries to post. Cause: the GitHub App scaffold ships both workflows with a read-only token:The job still goes green because a failed post isn't a job failure — so "success + no comment" is this misconfig, not a clean review.
Fix
Bump
pull-requestsandissuestowriteon both workflows (claude-code-review.ymlandclaude.yml).Why this must land on
mainclaude-code-actionrefuses to run when the workflow file on a PR branch differs from the copy on the default branch (a self-modification guard against secret exfiltration). So this change cannot be validated on its own PR — it takes effect on the next normal PR opened after it merges tomain.Security note
pull-requests: writeon apull_requesttrigger is sensitive only if this repo accepts fork PRs. This is a private, internal-only org repo with no forks, so the risk is negligible. If external forks are expected later, switch topull_request_targetwith author restrictions.🤖 Generated with Claude Code