ci: skip Claude review on fork PRs instead of failing - #28
Merged
Conversation
The label-gated review job failed whenever the 'claude-review' label was applied to a fork PR (e.g. #27): GitHub withholds secrets and the OIDC token from fork-originated pull_request events, so the action gets an empty CLAUDE_CODE_OAUTH_TOKEN and 'Unable to get ACTIONS_ID_TOKEN_REQUEST_URL'. Guard the job to same-repo PRs so labeling a fork is a clean no-op (skipped, neutral) rather than a red-flagged failure. Same-repo PRs are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 label-gated
claude-reviewjob fails whenever theclaude-reviewlabel is applied to a fork PR (e.g. #27 from `wsl2000`'s fork). GitHub deliberately withholds secrets and the OIDC token from fork-originated `pull_request` events, so the action receives an empty `CLAUDE_CODE_OAUTH_TOKEN` and errors with:Same-repo PRs (#23–26) review fine — only forks break.
Fix
Guard the job with a same-repo condition so labeling a fork PR is a clean no-op (skipped, neutral) rather than a guaranteed red failure:
claude-reviewlabel → review runs as beforeclaude-reviewlabel → job skipped, no red Xpull_request_target)Fork PRs can still be reviewed by pushing the branch to the main repo (collaborators have push access) and labeling there.
🤖 Generated with Claude Code