Skip to content

Comments

fix(ci): fix claude-pr-review checkout for fork PRs#827

Merged
diegomrsantos merged 1 commit intosigp:unstablefrom
diegomrsantos:fix/claude-pr-review-fork-checkout
Feb 11, 2026
Merged

fix(ci): fix claude-pr-review checkout for fork PRs#827
diegomrsantos merged 1 commit intosigp:unstablefrom
diegomrsantos:fix/claude-pr-review-fork-checkout

Conversation

@diegomrsantos
Copy link
Member

Issue Addressed

The claude-pr-review workflow fails on all fork PRs with:

fatal: couldn't find remote ref pull/N/head

Proposed Changes

Remove the repository and ref overrides from the checkout step. The explicit repository: head.repo.full_name and ref: head.ref set origin to the fork repo, but claude-code-action internally runs git fetch origin pull/N/head:... expecting origin to be the base repo (sigp/anchor) where PR refs live. A plain actions/checkout@v4 keeps origin as the base repo, and the action handles switching to the PR branch itself.

Additional Info

Confirmed the same failure on multiple fork PRs (#824, shane-moore PRs) while merge-queue PRs from sigp/anchor succeed — consistent with origin pointing to the wrong repo after the fork-specific checkout.

The checkout step was explicitly setting origin to the fork repo via
`repository` and `ref` overrides. The claude-code-action then runs
`git fetch origin pull/N/head:...` expecting origin to be the base
repo (sigp/anchor) where PR refs live. Remove the overrides so origin
stays as the base repo and let the action handle switching to the PR
branch internally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude-code-actions-sigp
Copy link

Claude Code is working…

I'll analyze this and get back to you.

View job run

Copy link
Member

@shane-moore shane-moore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, had started looking into this as well and found same root cause issue, need origin to stay as sigp/anchor. agree with this approach

@diegomrsantos diegomrsantos merged commit c7a8d9c into sigp:unstable Feb 11, 2026
16 of 18 checks passed
diegomrsantos added a commit to diegomrsantos/anchor that referenced this pull request Feb 11, 2026
claude-code-action@v1 recently changed (PR #851) to fetch PR branches
via `git fetch origin pull/N/head:...` before calling configureGitAuth().
This requires origin to point to the base repo with a token that can
access fork PR refs.

Fix by:
- Removing fork-specific repository/ref overrides from checkout
- Generating the app token before checkout and passing it via token:

Cherry-pick of sigp#827 and sigp#828 from unstable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shane-moore pushed a commit to shane-moore/anchor that referenced this pull request Feb 17, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
shane-moore pushed a commit to shane-moore/anchor that referenced this pull request Feb 17, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants