fix(ci): claude-mentions fork PR checkout for action v1.0.127 - #1054
Merged
Conversation
jnhsigmap
approved these changes
May 23, 2026
jnhsigmap
left a comment
Contributor
There was a problem hiding this comment.
I verified the stated change vector and this looks fine to me, well caught :)
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.
Problem, Evidence, and Context (Required)
PR #1042 bumped
anthropics/claude-code-actionfromv1.0.52tov1.0.127. v1.0.127 added fork-PR fetch logic that assumesoriginis the base repo:claude-mentions.ymlpredated this: whenis_fork == 'true', it pre-pointedoriginat the fork via theactions/checkoutrepository:override. The fork doesn't haverefs/pull/N/head(that namespace lives only on the base repo), so the action's fetch fails for every fork PR.Live failure on PR #1053 (fork PR from
shane-moore/anchor, run 26296833180):claude-pr-review.ymlalready runs the correct pattern (origin = base repo, app-token embedded before checkout; see its ownlines 63-68comment block). This PR bringsclaude-mentions.ymlin line with it.Related: issue #1043 (separate stale-fork-base diff misattribution bug). Its proposed prompt fix is intentionally kept out of this PR to split by blast radius.
Change Overview (Required)
One file:
.github/workflows/claude-mentions.yml.Get PR info for fork supportstep. Its four outputs were consumed only by the now-removedrepository:andref:overrides; no other steps reference them.Generate GitHub App tokento run beforeCheckout repositoryso the token is embedded inoriginfor the action's PR-ref fetch (matches the ordering and rationale documented inclaude-pr-review.yml:63-68).Checkout repositoryto drop bothrepository:andref:overrides. With defaults,origin = sigp/anchorand v1.0.127'sgit fetch origin pull/N/head:branchsucceeds because that ref exists on the base repo.End state structurally mirrors
claude-pr-review.yml:63-82.Intentionally unchanged:
stable-loaded workflows (Phase 1 of #1040) #1042.claude-pr-review.yml(already correct)..github/prompts/review.md(deferred; tied to ci: claude review bot uses fork's stale base branch when computing PR diff #1043).Risks, Trade-offs, and Mitigations (Required)
@claudemention plus org-membership check.isCrossRepository: false) doesgit fetch origin <branchName>againstorigin = sigp/anchor, which works in both old and new flavors.actions/checkoutdefaults to the base repo at the default branch, andsetupBranch()skips the PR-fetch path whenisPR == false.pull_request_review_commentevents:GITHUB_REFisrefs/pull/N/merge(resolvable fromsigp/anchor), then the action does its ownpull/N/headfetch. Should work; only fully empirical post-merge.claude-pr-review.ymlfor fork PR ref fetches, so the GitHub App installation onsigp/anchoralready has the required permissions.Validation (Required)
setupBranch()runs beforeconfigureGitAuth()inclaude-code-action/src/modes/tag/index.ts:66, 83.configureGitAuth()rewritesorigintocontext.repository.owner/repo(base repo, derived fromGITHUB_REPOSITORYenv) insrc/github/operations/git-config.ts:82.actions/checkouttoken must already be valid for fork PR ref reads on the base repo at the momentsetupBranch()runs. This PR ensures that.actionlintpasses on the changed file. The remaining SC2086 warnings are pre-existing in untouched shell blocks.@claudeon it.fatal: couldn't find remote ref pull/N/head).Rollback
Revert this single commit. No data, config, or operational state involved. Restores the prior (broken) fork-PR behavior but is otherwise neutral.
Blockers / Dependencies
None. Targets
stable.issue_commentandpull_request_review_commenttriggers load this workflow from the base repo's default branch, so the fix only takes effect once merged tostable(same rule that applied to PRs #830, #844, #845, #974, #997, #1042).