ci: skip Claude Code Review on fork PRs#107
Merged
Merged
Conversation
GitHub Actions does not pass repository secrets (`CLAUDE_CODE_OAUTH_TOKEN`) or emit OIDC tokens for `pull_request` workflows triggered by forks. The `anthropics/claude-code-action@v1` action consequently fails with "Could not fetch an OIDC token" every time an external contributor opens a PR, leaving a spurious red check on the rollup. Gate the job on `github.event.pull_request.head.repo.fork == false` so the workflow is skipped (not failed) for fork PRs. Maintainers can still trigger a code review manually by mentioning @claude in a comment — that path goes through `claude.yml` (`workflow_dispatch` / `issue_comment` triggers) which runs in the upstream repo's security context with access to secrets. No behaviour change for PRs opened from branches in the upstream repo. Refs PR #106 (Telnyx recording parity by external contributor) which surfaced the noise.
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
Claude Code Reviewworkflow on PRs opened from forks (1-lineif:guard on the job).pull_request-triggered workflows —anthropics/claude-code-action@v1consequently fails withCould not fetch an OIDC tokenand leaves a spurious red check on every external contribution.Implementation
.github/workflows/claude-code-review.yml: addif: github.event.pull_request.head.repo.fork == falseto theclaude-reviewjob.@claudemention viaclaude.yml).Breaking change?
No. The workflow keeps its full behaviour for PRs opened from branches in the upstream repo. Only fork PRs are affected — they previously failed with an OIDC error, now they skip the job cleanly.
Test plan
gh workflow view "Claude Code Review"— syntax valid (action YAML loads).claude-reviewshould reportSkipped, notFailure.Docs updates
N/A (CI-only change, not user-visible — no CHANGELOG entry per
documentation-best-practices.mdinvariant 0 exemption for pure refactors with zero behaviour change to the SDKs).Why now
Surfaced by #106 (external contributor's Telnyx recording parity PR). The failing
claude-reviewcheck is non-required so it doesn't actually block the merge, but it adds noise to every fork-PR rollup and makes "all green" status checks impossible for external contributors. Cleaner to skip than to fail.