Skip to content

ci: skip the automatic Claude review on fork PRs - #36

Merged
prashar32 merged 1 commit into
mainfrom
ci/skip-auto-review-on-forks
May 31, 2026
Merged

ci: skip the automatic Claude review on fork PRs#36
prashar32 merged 1 commit into
mainfrom
ci/skip-auto-review-on-forks

Conversation

@prashar32

Copy link
Copy Markdown
Owner

Problem

GitHub doesn't pass repository secrets to workflows triggered by PRs from forks, so CLAUDE_CODE_OAUTH_TOKEN is unavailable and the Claude PR Review action fails to fetch a token — every external contribution gets a spurious red review check (seen on #35). It's not a required check, but it's noise and looks like the PR is broken.

Change

Gate the review job to same-repo PRs:

if: github.event.pull_request.head.repo.full_name == github.repository

Fork PRs now skip the job (grey/neutral) instead of failing it.

Reviewing external PRs is unchanged

On-demand review still works on any PR, including forks: the maintainer comments @claude, which runs claude.yml on issue_comment — that event runs in the base-repo context where the secret is available, and the job is already locked to prashar32.

No required-check or behavior change for same-repo PRs.

GitHub doesn't expose repo secrets (CLAUDE_CODE_OAUTH_TOKEN) to PRs from forks,
so the review action can't authenticate and the job always fails — a spurious red
check on every external contribution (e.g. #35). Gate the job to same-repo PRs
(head.repo.full_name == the repo) so fork PRs skip it cleanly instead.

External PRs are still reviewable on demand: the maintainer comments "@claude",
which runs claude.yml on issue_comment in the base-repo context where the secret
is available (and is locked to prashar32).
@prashar32
prashar32 merged commit 79e24e3 into main May 31, 2026
4 of 5 checks passed
@prashar32 prashar32 mentioned this pull request May 31, 2026
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.

1 participant