Skip to content

Let the auto review actually post its findings - #83

Merged
aj604 merged 1 commit into
mainfrom
ajones/auto-review-perms-4f35f5
Jul 27, 2026
Merged

aj604 merged 1 commit into
mainfrom
ajones/auto-review-perms-4f35f5

Conversation

@aj604

@aj604 aj604 commented Jul 27, 2026 •

Copy link
Copy Markdown
Owner

The Claude Code Review workflow has never posted a comment on a PR in this repo — not once, including during the stretch when its runs were green. Three things sat between the review and the PR.

What was wrong

pull-requests: read The review posts inline comments and a summary via gh pr comment. Read-only drops both, and the job still exits 0.
No --comment Without the flag the upstream /code-review command stops at its step 7 and prints findings to the runner log — invisible in an unattended run.
No tool allowlist The action's defaults are narrower than the command needs. A rerun on 2026-07-26 logged 72 permission denials; the 2026-07-10 runs logged 1.

Evidence for the first claim: PRs #37–#52 were open while the workflow was green (one run went 24 turns, $0.79, is_error: false) and carry zero comments from Claude.

The fix

pull-requests: write, --comment on the prompt, and a claude_args allowlist mirroring the upstream command's own allowed-tools frontmatter, plus Task (its steps 1–5 run entirely in subagents) and read-only git for the full-SHA permalinks in step 9.

--allowedTools via claude_args is the supported route here, not a workaround: the allowed_tools action input is formally deprecated in its favor, and the action's own pr-review-comprehensive example passes the list explicitly rather than relying on command frontmatter. There is no input that auto-grants a plugin's declared tools.

Not part of this change

Every run from ~2026-07-10 until this evening died at the credential — is_error: true at turn 1, ~2s, $0, across doc-sync.yml too, with no YAML change on either side. That was a stale CLAUDE_CODE_OAUTH_TOKEN, since rotated; a rerun of the last failed review now goes 11 turns clean. Those runs only began showing red on 2026-07-14, when claude-code-action#1496 made the step fail on is_error: true — the breakage predates the red.

Verification — cannot happen on this PR

This PR's own review run is green but did nothing. The action refuses to execute when the
PR modifies the workflow it would run:

Skipping action due to workflow validation: the workflow file must exist and have identical
content to the version on the base branch.

That guard is deliberate, and it means a self-test is impossible here — the green check on
run 30226727806 is not evidence
the fix works. The first real test is the next PR opened after this one merges. What to look
for in that run: a comment from Claude on the PR, and permission_denials_count in the log
(today's baseline is 72). A full review costs roughly $7.

Caveat on the allowlist: it is derived from what the command declares it needs, because the
action hides the SDK stream and reports only a denial count, never the tool names. If something
is still missing, the first post-merge run will show a non-zero count.

Unpinned dependency, noted but not addressed: plugin_marketplaces clones anthropics/claude-code from main every run, so the command can change without a diff here.

🤖 Generated with Claude Code

The Claude Code Review workflow has never left a comment on a PR. Three
things stood between the run and the PR:

- `pull-requests: read` — the review posts inline comments and a summary
  via `gh pr comment`; read-only drops both.
- No `--comment` on the prompt, so the upstream /code-review command
  stops at step 7 and prints to the runner log, which nothing reads.
- No tool allowlist. The action's defaults are narrower than the command
  needs: a 2026-07-26 rerun logged 72 permission denials, against 1 in
  the runs from 2026-07-10.

Verified against PRs 37-52, which were open while the workflow was
green: zero comments from Claude on any of them.

Separately and already resolved: every run between 2026-07-10 and the
CLAUDE_CODE_OAUTH_TOKEN rotation died at the credential (is_error with
one turn, ~2s, $0). Those runs only started reporting red on 2026-07-14,
when claude-code-action#1496 taught the step to fail on is_error.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@aj604
aj604 merged commit 5e6df42 into main Jul 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant