Repository navigation
ci(claude-review): skip automatic review on fork PRs - #538
Merged
Merged
Conversation
Fork PRs receive a read-only GITHUB_TOKEN and no repository secrets, so claude-code-action fails with 403 'Resource not accessible by integration' when creating its initial comment. Every fork PR (#525, #527, #529, #532-#535) has been failing this check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCRwrpJY25CRtyTcu6aD8V
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @ajitpratap0's task —— View job PR Review: skip automatic Claude review on fork PRs
Verdict: LGTM. The fix is small, correct, and safe. I have one suggestion (Dependabot) and a few nits, none of which block the merge. What it does
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repositoryFork PRs now show the check as skipped instead of failed. Correctness
Security
Suggestions
Nits (non-blocking)
Test coverageIt's a CI-only change, so there are no Go tests to add. The first unchecked item (same-repo PR still runs the review) is demonstrated by this PR's own review run. The second needs the next fork PR. --- | Branch: |
1 of 3 tasks
This branch was successfully deployed
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
The Claude Code Review check fails on every PR opened from a fork (#525, #527, #529, #532–#535). Fork PRs get a read-only
GITHUB_TOKENand no repository secrets (the logs showclaude_code_oauth_tokenis empty), so the action fails with403 Resource not accessible by integrationwhen it posts its first comment.This adds a job-level
ifso the review runs only for same-repo PRs andworkflow_dispatch. Fork PRs now show the check as skipped rather than failed. Maintainers can still ask for a review on a fork PR by commenting@claude(handled byclaude.yml, which runs on the base repo).I didn't use
pull_request_target, because it would expose secrets and a write token to untrusted fork code and prompts.The other failure, same-repo PRs getting 404 from the retired
claude-sonnet-4-20250514, was already fixed by #536.Test Plan
ifexpression is a valid job conditionBreaking Changes
None. Fork PRs no longer get an automatic Claude review comment, but they weren't getting one before either.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VCRwrpJY25CRtyTcu6aD8V