Skip to content

fix(ci): use app token for checkout in claude-pr-review#828

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

fix(ci): use app token for checkout in claude-pr-review#828
diegomrsantos merged 1 commit intosigp:unstablefrom
diegomrsantos:fix/claude-pr-review-app-token

Conversation

@diegomrsantos
Copy link
Member

Issue Addressed

claude-pr-review fails on all fork PRs since Feb 11 with:

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

Proposed Changes

Generate the GitHub App token before the checkout step and pass it via token:.

Root cause: claude-code-action@v1 merged PR #851 on Feb 10, changing branch fetch from git fetch origin <branchName> to git fetch origin pull/N/head:<branchName>. The action calls setupBranch() (which runs this fetch) before configureGitAuth(), so it uses whatever token actions/checkout embedded in origin. The default github.token cannot fetch fork PR refs, causing the failure.

Additional Info

  • The previous fix (fix(ci): fix claude-pr-review checkout for fork PRs #827) correctly removed the fork-specific repository/ref overrides but didn't address the token issue
  • Fork PR runs succeeded on Feb 10 (before the claude-code-action update) and started failing on Feb 11
  • Same-repo runs (merge queue) continue to succeed since github.token can access those refs

claude-code-action@v1 recently changed (PR sigp#851) to fetch PR branches
via `git fetch origin pull/N/head:...` before calling configureGitAuth().
The default github.token embedded by actions/checkout cannot fetch fork
PR refs. Fix by generating the app token first and passing it to
actions/checkout so origin has proper credentials from the start.

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

@diegomrsantos diegomrsantos self-assigned this Feb 11, 2026
@diegomrsantos diegomrsantos merged commit 227867e into sigp:unstable Feb 11, 2026
18 of 19 checks passed
diegomrsantos added a commit to diegomrsantos/anchor that referenced this pull request Feb 11, 2026
claude-code-action@v1 recently changed (PR sigp#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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants