Skip to content

fix: enable Claude Code Review for fork PRs#2145

Merged
GigaHierz merged 1 commit intomainfrom
fix/claude-review-fork-prs
Mar 9, 2026
Merged

fix: enable Claude Code Review for fork PRs#2145
GigaHierz merged 1 commit intomainfrom
fix/claude-review-fork-prs

Conversation

@viral-sangani
Copy link
Collaborator

Summary

  • Changes pull_request trigger to pull_request_target so the workflow runs in the base repo context, making OIDC tokens and secrets available for fork PRs
  • Changes pull-requests: read to pull-requests: write so Claude can post review comments

Fixes the claude-review check failure on fork PRs like #2144 (error: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable).

Security

This follows the safe pull_request_target pattern:

  • Workflow definition is always read from the base branch (forks cannot modify it)
  • actions/checkout checks out the base branch only (no ref: override)
  • No untrusted fork code is checked out or executed
  • Claude Code Action reads PR diffs via the GitHub API

Test plan

🤖 Generated with Claude Code

Use pull_request_target trigger so the workflow runs in the base repo
context, allowing OIDC tokens and secrets to be available for fork PRs.
Also change pull-requests permission to write so Claude can post review
comments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GigaHierz GigaHierz merged commit 5669d52 into main Mar 9, 2026
5 checks passed
@GigaHierz GigaHierz deleted the fix/claude-review-fork-prs branch March 9, 2026 15:52
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.

2 participants