claude.yml: grant actions:write so @claude can dispatch code review#911
Conversation
The post-Claude steps call `gh workflow run claude-code-review.yml` to
fire the dedicated reviewer via workflow_dispatch, but the job granted
only `actions: read`. The workflow_dispatch REST endpoint
(POST /actions/workflows/{id}/dispatches) requires `actions: write` for
GITHUB_TOKEN, so every dispatch returned
HTTP 403: Resource not accessible by integration
and was swallowed by the `|| echo "::warning::"` fallback — the
code-review never auto-ran. Directly observed on PR #900 run
27598978484 (the @claude-review dispatch 403'd silently); no dispatched
claude-code-review.yml run has succeeded from claude.yml as a result.
Bump `actions: read` -> `actions: write` (a superset, so Claude's
CI-result reads still work) and correct the now-inaccurate dispatch
comment to note the write requirement.
Workflow/infra-only change, kept in its own PR per CLAUDE.md.
|
Claude finished @d-morrison's task in 1m 30s —— View job Code Review: PR #911 —
|
|
Claude finished @d-morrison's task in 1m 35s —— View job Code Review: PR #911 —
|
What
Grant the
claude.ymljobactions: write(wasactions: read) so the post-Claude steps can actually dispatch the dedicated code-review workflow.Root cause
claude.ymlfires the reviewer viagh workflow run claude-code-review.yml(theworkflow_dispatchREST endpointPOST /actions/workflows/{id}/dispatches) in three steps. That endpoint requiresactions: writeforGITHUB_TOKEN, but the job only grantedactions: read. So every dispatch returned:…and the error was swallowed by the
|| echo "::warning::…"fallback on each call. Net effect:@claude review(and the post-commit auto-dispatch) silently never triggered a review.Evidence
claude.ymlrun 27598978484, step "Dispatch claude-code-review.yml on @claude review comment": the 403 above, immediately followed by the swallowed warning.@claude reviewrequests produced only the "👀 Picked up…" ack and no review — andget_reviews/get_commentsshow no review content was ever posted there.workflow_dispatchrun ofclaude-code-review.ymlhas fired fromclaude.yml. (The handful ofworkflow_dispatchruns in the history are from May and predate the affected PRs — most likely manual dispatches.)git blameputsactions: readon this job since 2026-05-08, so this has been broken since at least then.Change
actions: read→actions: writein theclaudejob'spermissions:(one line;writeis a superset ofread, so Claude's CI-result reads are unaffected).GITHUB_TOKEN"is permitted to trigger workflow_dispatch" without noting theactions: writerequirement, and added a note at thepermissions:block so a future edit doesn't silently re-break it.Verification
python3 -c "import yaml; ..."parsesclaude.ymland confirmspermissions.actions == 'write'.@claude reviewshould then produce a dispatchedclaude-code-review.ymlrun instead of a swallowed 403).Context / related
This is the real fix for the gap that PR #900 was trying (ineffectively) to address. Investigation on #900 showed its actor-filter approach is a no-op — Claude's PR pushes arrive as actor
d-morrison(already reviewed) andclaude[bot]only ever firesissue_comment, neverpull_request— so the actual reason Claude-authored commits weren't getting reviewed is this broken dispatch, not theif:filter. #900 is being closed in favor of this PR.Per CLAUDE.md, this is a
.github/CI-only change kept in its own dedicated PR.https://claude.ai/code/session_01ER1dFrUPTjaHeL3n7Yy7qG
Generated by Claude Code