Skip to content

CI: fix claude-review failing at checkout on every fork PR - #21

Open
jnasbyupgrade wants to merge 2 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:fix-pwn-request-checkout
Open

CI: fix claude-review failing at checkout on every fork PR#21
jnasbyupgrade wants to merge 2 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:fix-pwn-request-checkout

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

claude-review currently fails for every PR from this fork at the checkout step (actions/checkout's "pwn request" refusal on pull_request_target).

Updated (the original fix here was wrong): allow-unsafe-pr-checkout: true plus keeping the repository:/ref: override that redirects origin to the fork silences the checkout refusal but trades it for a different failure — claude-code-action internally fetches refs/pull/<n>/head from this repo to read the PR's actual content, and that ref doesn't exist on the fork once origin is redirected there. Postgres-Extensions/extension_tools#28 hit and fixed the identical mistake.

The actual fix: remove the checkout override entirely. claude-code-action fetches and reads the PR's content itself; this step only needs to check out the base branch (no ref:/repository:, no allow-unsafe-pr-checkout).

  • Renamed the step to "Check out base branch", removed all with: overrides.
  • Updated the top-of-file SECURITY note and the trust-gate comment to match (no more manual fork checkout to justify).
  • Loud, non-removable warning stays on the trust-gate if: condition — still load-bearing defense-in-depth even though the checkout itself is now safe by construction.

Same pull_request_target self-verification limitation as before: this PR's own claude-review check runs the OLD workflow from master and can't demonstrate the fix on itself. Verification happens on a subsequent PR after this merges.

🤖 Generated with Claude Code

Likely trivial conflict with #15: both touch the same checkout step (#15 bumps @v4 -> @v7; this PR removes the with: block below it). Resolve by keeping @v7 with no with: overrides.

actions/checkout now refuses, by default, to check out a fork PR's head
under pull_request_target (a "pwn request" guard) -- this job has always
been safe to opt out of that guard (trusted-fork gate + read-only use),
it just started failing when the guard shipped.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5785201c-1a0c-478d-b7f1-a808f3f26877

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

allow-unsafe-pr-checkout: true plus a repository:/ref: override checking
out the fork directly is the wrong fix -- it silences the checkout
refusal but breaks claude-code-action's own internal fetch of
refs/pull/<n>/head (which only exists on this repo, not the fork), per
Postgres-Extensions/extension_tools#28 hitting and fixing the identical
mistake. The action already fetches and reads the PR's actual content
itself; this step only needs to check out the base branch.
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.

1 participant