Skip to content

ci(review): explicit caller-job permissions on the Claude review caller - #1790

Merged
heskew merged 1 commit into
mainfrom
ci/claude-caller-permissions
Jul 20, 2026
Merged

ci(review): explicit caller-job permissions on the Claude review caller#1790
heskew merged 1 commit into
mainfrom
ci/claude-caller-permissions

Conversation

@heskew

@heskew heskew commented Jul 14, 2026

Copy link
Copy Markdown
Member

One block: grant contents: read + pull-requests: write + id-token: write on the review calling job in claude-review.yml — the union of what the reusable's authorize and review jobs declare, matching gemini-review.yml in this repo (which has carried the block since it was added post ai-review-prompts#39/#40) and oauth's claude caller.

Why

Without an explicit block the caller inherits the repo's default-workflow-permissions setting: GitHub silently intersects the reusable's per-job requests with that ceiling (verified on a live run — granted set was exactly Contents: read, PullRequests: write, with the requested id-token: write dropped). Reviews work today only because the repo default is "write"; flipping that setting to "read" would break review posting with unhelpful 403s. Explicit job-level grants remove the hidden dependency.

Cross-references

Note: this PR edits the caller workflow, so its own Claude review check fails with the expected anti-tamper guard; clears on merge.


🤖 Generated with Claude Code

Grant contents:read + pull-requests:write + id-token:write at the
calling-job level (union of the reusable's per-job declarations),
matching gemini-review.yml in this repo and oauth's claude caller.
Without the block the grants come from the repo's
default-workflow-permissions setting — GitHub silently intersects the
reusable's requests with that ceiling, so pull-requests:write
survives only while the repo default is "write".

Surfaced by review feedback on rocksdb-js#701; pattern documented
upstream in ai-review-prompts#74. Addresses the claude-review.yml
entry in #568.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@kriszyp kriszyp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Least-privilege caller-job permissions are correct — the granted scopes are exactly the union the reusable workflow's jobs request, matching the existing gemini-review.yml block. Both red checks are explained non-regressions (anti-tamper guard that clears on merge + an unrelated uWS flake). Approving.

🤖 Reviewed with KrAIs (Claude Opus 4.8)

@Ethan-Arrowood Ethan-Arrowood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — explicit, minimal caller-job permissions, matching the established pattern. The red review / review check is the anti-tamper guard behaving as designed, not a real failure. Approving. (Sibling of harper-pro#580, same change.)

sent with Claude Opus 4.8

@heskew
heskew merged commit 659be27 into main Jul 20, 2026
50 of 53 checks passed
@heskew
heskew deleted the ci/claude-caller-permissions branch July 20, 2026 13:39
kriszyp added a commit that referenced this pull request Jul 24, 2026
v5.1's caller workflow was stuck at the pre-#1790/#1891 version — no
explicit id-token/pull-requests permissions block and an older
ai-review-prompts pin. GitHub's OIDC->app-token exchange for the
review job requires the invoking workflow file to be byte-identical
to the one on the repository's default branch (main), so every PR
based on v5.1 was failing "review / review" with a 401 workflow
validation error, unrelated to the PR's actual diff.

Co-Authored-By: Claude Opus <noreply@anthropic.com>
kriszyp added a commit that referenced this pull request Jul 28, 2026
v5.1's caller workflow was stuck at the pre-#1790/#1891 version — no
explicit id-token/pull-requests permissions block and an older
ai-review-prompts pin. GitHub's OIDC->app-token exchange for the
review job requires the invoking workflow file to be byte-identical
to the one on the repository's default branch (main), so every PR
based on v5.1 was failing "review / review" with a 401 workflow
validation error, unrelated to the PR's actual diff.

Co-Authored-By: Claude Opus <noreply@anthropic.com>
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.

4 participants