fix: enable Claude Code Review for fork PRs#2145
Merged
Conversation
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
approved these changes
Mar 9, 2026
viral-sangani
added a commit
that referenced
this pull request
Mar 16, 2026
Reverts the pull_request_target trigger back to pull_request. The pull_request_target trigger was introduced in #2145 to support fork PRs, but Anthropic's OIDC token exchange endpoint does not accept tokens from pull_request_target events, causing 100% failure rate on all reviews since March 9th. This is a known upstream issue: anthropics/claude-code-action#713 Until Anthropic adds pull_request_target to their OIDC allowlist, we revert to pull_request which works for same-repo branch PRs.
GigaHierz
pushed a commit
that referenced
this pull request
Mar 16, 2026
Reverts the pull_request_target trigger back to pull_request. The pull_request_target trigger was introduced in #2145 to support fork PRs, but Anthropic's OIDC token exchange endpoint does not accept tokens from pull_request_target events, causing 100% failure rate on all reviews since March 9th. This is a known upstream issue: anthropics/claude-code-action#713 Until Anthropic adds pull_request_target to their OIDC allowlist, we revert to pull_request which works for same-repo branch PRs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pull_requesttrigger topull_request_targetso the workflow runs in the base repo context, making OIDC tokens and secrets available for fork PRspull-requests: readtopull-requests: writeso Claude can post review commentsFixes the
claude-reviewcheck failure on fork PRs like #2144 (error:Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable).Security
This follows the safe
pull_request_targetpattern:actions/checkoutchecks out the base branch only (noref:override)Test plan
main, then close/reopen PR Add Indexing Co indexer page #2144 to re-triggerclaude-reviewcheck passes and Claude posts review comments on the fork PR🤖 Generated with Claude Code