ci: skip Claude review on fork PRs - #14
Merged
Merged
Conversation
Fork-triggered pull_request runs get no secrets and no OIDC token, so the claude-code-action can't authenticate and the check fails on every external PR (e.g. #13) through no fault of the contributor. Skip the claude-review job on forks. Fork PRs can still be reviewed on demand by commenting "@claude review the changes", which runs through claude.yml's issue_comment trigger in the base-repo context where secrets and OIDC are available.
Merged
1 task
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.
Problem
The Claude Code Review check fails on every PR from a fork (e.g. #13) with:
This is not a missing-permission bug (the workflow already requests
id-token: write) and not the contributor's fault. GitHub deliberately withholds repository secrets and the OIDC token from fork-triggeredpull_requestruns as a security measure, soanthropics/claude-code-actioncan't authenticate and fails before it reads the diff. Same-repo PRs are unaffected (they pass).Confirmed against the run history: the two same-repo PRs succeeded; the one fork PR (#13) failed. See upstream anthropics/claude-code-action#339 (labeled
bug/p1), #542, #649.Fix
Skip the
claude-reviewjob on fork PRs viaif: github.event.pull_request.head.repo.fork == false. Fork PRs now show a neutral "skipped" check instead of a red ❌.Fork PRs can still be reviewed on demand by commenting
@claude review the changeson the PR — that firesclaude.yml'sissue_commenttrigger, which runs in the base-repo context where secrets and OIDC are available.Considered but rejected:
pull_request_target(would auto-review forks but runs with repo secrets against untrusted code — real prompt-injection / token-minting risk per upstream security guidance).🤖 Generated with Claude Code