claude-code-review.yml: stop checking out fork PR head, restore base-branch checkout - #71
Merged
jnasbyupgrade merged 1 commit intoAug 2, 2026
Conversation
…branch checkout anthropics/claude-code-action's internal setupBranch() logic fetches a fork PR's branch itself via `git fetch origin pull/<N>/head:<branch>`, which requires `origin` to be the base repo (only the base repo carries refs/pull/<N>/head). Checking out the fork directly first, as this workflow's "Check out PR head" step did, points origin at the fork instead, which has no such ref -- breaking that fetch with "couldn't find remote ref pull/<N>/head" and silently failing the review on every fork PR (confirmed on Postgres-Extensions#54, reproduced identically on rerun). This exact failure mode was already fixed once, in c38cf2a ("never check out fork PR head..."), which switched to a plain base-branch checkout and let the action fetch the PR itself -- the safe, intended pattern per the action's own examples. db6ae56 ("add missing --comment flag") bundled in an accidental revert of that fix alongside its actual fix, reintroducing the fork checkout and the allow-unsafe-pr-checkout escape hatch. This restores the base-branch checkout on top of everything db6ae56 and later commits actually intended to change. Per .github/workflows/CLAUDE.md, pull_request_target always runs the workflow file from master, so this PR's own claude-review check cannot prove the fix -- verification happens on the next PR after this merges.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
jnasbyupgrade
merged commit Aug 2, 2026
b91044b
into
Postgres-Extensions:master
11 of 36 checks passed
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.
anthropics/claude-code-action's internal setupBranch() logic fetches a fork PR's branch itself via
git fetch origin pull/<N>/head:<branch>, which requiresoriginto be the base repo (only the base repo carriesrefs/pull/<N>/head). Checking out the fork directly first, as this workflow's "Check out PR head" step did, pointsoriginat the fork instead, which has no such ref -- breaking that fetch with "couldn't find remote ref pull//head" and silently failing the review on every fork PR (confirmed on #54, reproduced identically on rerun).This exact failure mode was already fixed once, in c38cf2a ("never check out fork PR head..."), which switched to a plain base-branch checkout and let the action fetch the PR itself -- the safe, intended pattern per the action's own examples. db6ae56 ("add missing --comment flag") bundled in an accidental revert of that fix alongside its actual fix, reintroducing the fork checkout and the
allow-unsafe-pr-checkoutescape hatch. This restores the base-branch checkout on top of everything db6ae56 and later commits actually intended to change.Per
.github/workflows/CLAUDE.md,pull_request_targetalways runs the workflow file frommaster, so this PR's ownclaude-reviewcheck cannot prove the fix -- verification happens on the next PR after this merges.Test plan
python3 -c "import yaml; yaml.safe_load(...)"on the changed workflow fileclaude-reviewcheck succeeds and posts a real review comment (this PR's own check will still run master's pre-fix version, per the note above)