Stop checking out the fork PR head in claude-code-review.yml - #53
Conversation
actions/checkout refuses to check out a fork PR's head under pull_request_target by default (a hard-coded safety refusal added in a patch-level actions/checkout@v4 release), so review never actually ran against a genuine fork-originated PR - only against same-repo/upstream-branch PRs, which don't hit this check. The fix is not to opt back in via allow-unsafe-pr-checkout: true: claude-code-action already fetches and reads the PR's real content itself, internally, via the base repo's own refs/pull/<n>/head, so there is no reason for this job to put the fork's files in the workspace at all. The checkout step now fetches the base ref only, matching claude-code-action's own documented recommended pattern. pull_request_target always runs the workflow file from the base branch, so this PR's own claude-review check will still run the OLD broken workflow and fail the same way - that's expected, not a sign the fix doesn't work. Verification happens on a subsequent PR, after this merges to master.
📝 WalkthroughWalkthroughThe workflow documentation now states that Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
|
@claude pls review |
|
Claude finished @jnasbyupgrade's task in 2m 7s —— View job Review of PR #53
Verdict: looks correct, sound security improvement, no blocking issues. What changed: Security reasoning holds up:
One thing I couldn't independently verify: the specific claim that Expected self-failure note: the PR body's explanation that this PR's own No changes requested. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/claude-code-review.yml:
- Around line 91-94: Update the actions/checkout reference in the
pull_request_target workflow to a verified full-length commit SHA instead of the
mutable v4 tag, and retain the existing security comment while documenting the
pinned version if appropriate. Ensure future SHA updates can be managed by
Dependabot or Renovate.
- Around line 89-97: Update the workflow’s Claude action reference from the
mutable anthropics/claude-code-action@v1 tag to a known-good immutable commit
SHA, while preserving the existing action configuration and checkout behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c0047cf0-53ce-4f0b-9026-66c661e2a480
📒 Files selected for processing (1)
.github/workflows/claude-code-review.yml
77a527d
into
Postgres-Extensions:master
Dropped along with the fork-checkout override, but it's independently worth keeping: this job never pushes anything, so there's no reason to leave a push-capable credential in .git/config for the rest of the job. Matches Postgres-Extensions/pg_count_nulls#53's version of this same fix.
actions/checkout refuses to check out a fork PR's head under pull_request_target by default (a hard-coded safety refusal added in a patch-level actions/checkout@v4 release), so review never actually ran against a genuine fork-originated PR — only against same-repo/upstream-branch PRs, which don't hit this check. The fix is not to opt back in via allow-unsafe-pr-checkout: true: claude-code-action already fetches and reads the PR's real content itself, internally, via the base repo's own refs/pull//head, so there's no reason for this job to put the fork's files in the workspace at all. The checkout step now fetches the base ref only, matching claude-code-action's own documented recommended pattern.
Note: pull_request_target always runs the workflow file from the base branch, so this PR's own claude-review check will still run the OLD broken workflow and fail the same way — that's expected, not a sign the fix doesn't work. Verification happens on a subsequent PR, after this merges to master.