Skip to content

Comments

fix(ci): fix claude-pr-review failing on fork PRs#829

Closed
diegomrsantos wants to merge 1 commit intosigp:stablefrom
diegomrsantos:fix/claude-pr-review-stable
Closed

fix(ci): fix claude-pr-review failing on fork PRs#829
diegomrsantos wants to merge 1 commit intosigp:stablefrom
diegomrsantos:fix/claude-pr-review-stable

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

pull_request_target reads workflow files from the default branch (stable), so this fix must land here.

Proposed Changes

  • Remove fork-specific repository/ref overrides from checkout (origin must point to base repo where PR refs live)
  • Generate the GitHub App token before checkout and pass it via token:

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

Additional Info

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>
@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.

LGTM. Root cause was anthropics/claude-code-action@v1 updating to v1.0.48 on Feb 10, which changed PR checkout from git fetch origin <branch-name> to git fetch origin pull/N/head:..... The new approach assumes origin is the base repo, but our workflow was overriding it to the fork. The app token change is fine but the real fix is removing the fork-specific checkout overrides imo

@shane-moore
Copy link
Member

regarding the CI failures:

  • this PR aims to fix the Claude PR Review issue
  • target-branch-check would have to be bypassed since we dont want to merge everything from unstable to stable for some time
  • check-code failure was resolved with fix: update bytes to 1.11.1 to fix RUSTSEC-2026-0007 #797 to unstable, so those changes will get into stable eventually

@shane-moore
Copy link
Member

shane-moore commented Feb 12, 2026

ran this flow locally w/o issue to prove to myself we wouldn't see merge issues later:

  1. merge this PR → stable: fast-forward (no merge needed, stable
    was behind)
  2. merge stable → unstable: auto-merged cleanly (Git
    resolved overlapping changes automatically since the
    diffs were compatible)
  3. merge unstable → stable: fast-forward again

@shane-moore
Copy link
Member

Closing this since claude has resolve the issue on their end anthropics/claude-code-action#931

@diegomrsantos
Copy link
Member Author

Closing this since claude has resolve the issue on their end anthropics/claude-code-action#931

Imo it's better to use fixed versions for everything, so we avoid disruptions lile that. It consumes time and it's not the first time it happens

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