mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-07-28 14:58:30 +08:00
When a PR originates from a fork, `git fetch origin <branch>` fails because the branch only exists on the fork's remote. Fix: detect cross-repository PRs via the `isCrossRepository` GraphQL field and fetch using `pull/<number>/head:<branch>` refspec instead, which is the standard GitHub mechanism for accessing fork PR branches. Changes: - Add `isCrossRepository` and `headRepository` to PR GraphQL query - Add corresponding fields to GitHubPullRequest type - Branch checkout uses pull ref for fork PRs - Update test fixtures with new fields Co-authored-by: User <user@example.com>