From 24a89b4a10ebbc2eba3221d9af3328e9e43cc89e Mon Sep 17 00:00:00 2001 From: Nick Koutrelakos Date: Tue, 1 Sep 2026 17:13:27 -0700 Subject: [PATCH 1/2] fix(ci): make the AI review workflow run under pull_request_target The review job has failed on every PR since it landed. The action trades an OIDC token for a Claude GitHub App token, and Anthropic's exchange rejects tokens minted under `pull_request_target` (anthropics/claude-code-action#713). Pass the job token instead, which skips the exchange, and allow non-write actors so community PRs are reviewed. Drop the now-unused `id-token: write` permission. Comments will post as github-actions[bot]. --- .github/workflows/claude-code-review.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 31b5b42b8..e9f2b9b0f 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -30,7 +30,6 @@ concurrency: permissions: contents: read pull-requests: write - id-token: write # OIDC exchange for the Claude GitHub App token jobs: review: @@ -48,6 +47,19 @@ jobs: - uses: anthropics/claude-code-action@1298632ce7736903d02a1435002705aa2a594a6c # v1.0.175 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + # By default the action trades an OIDC token for a Claude GitHub App + # token, and Anthropic's exchange rejects tokens minted under + # `pull_request_target` (anthropics/claude-code-action#713). Passing the + # job token skips that exchange. Under `pull_request_target` the job + # token carries this workflow's declared permissions, so it can post + # comments. Comments appear as github-actions[bot], not claude[bot]. + github_token: ${{ secrets.GITHUB_TOKEN }} + # The action refuses actors without write access, and community + # authors never have it here. This is the documented escape hatch for + # exactly this shape: a job token scoped to `pull-requests: write`, the + # PR head never checked out, and tools limited to reading the diff and + # posting comments. + allowed_non_write_users: '*' prompt: | REPO: ${{ github.repository }} PR NUMBER: ${{ github.event.pull_request.number }} From 00963c00910ad83884036570e99f88ade121ecc7 Mon Sep 17 00:00:00 2001 From: Nick Koutrelakos Date: Tue, 1 Sep 2026 17:19:41 -0700 Subject: [PATCH 2/2] fix(ci): describe allowed_non_write_users as the action's own docs do --- .github/workflows/claude-code-review.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index e9f2b9b0f..dfa8116e2 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -55,8 +55,9 @@ jobs: # comments. Comments appear as github-actions[bot], not claude[bot]. github_token: ${{ secrets.GITHUB_TOKEN }} # The action refuses actors without write access, and community - # authors never have it here. This is the documented escape hatch for - # exactly this shape: a job token scoped to `pull-requests: write`, the + # authors never have it here. This input is the action's escape hatch. + # Its docs restrict it to workflows with very limited permissions, and + # this one qualifies: a job token scoped to `pull-requests: write`, the # PR head never checked out, and tools limited to reading the diff and # posting comments. allowed_non_write_users: '*'