ci: never check out fork PR head in claude-code-review pull_request_target job#70
Merged
jnasbyupgrade merged 2 commits intoJul 26, 2026
Conversation
actions/checkout now refuses to check out fork PR code under pull_request_target unless allow-unsafe-pr-checkout is explicitly set, which broke the claude-review job for PRs from the trusted jnasbyupgrade fork. Opt in explicitly; safe here because the job is already gated to that fork owner only. Also bump actions/checkout to v6 while touching this step. Mirrors the same fix already applied on Postgres-Extensions/cat_tools. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
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:
✨ Finishing Touches🧪 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 |
Supersede the allow-unsafe-pr-checkout opt-in from the previous commit. Per anthropics/claude-code-action's own security guidance (docs/security.md), the preferred pattern for pull_request_target is to check out the base ref only and let the action read PR content via the GitHub API — it already has a token with pull-requests read/write. This avoids ever writing fork code to disk, rather than opting into the "unsafe" checkout flag. Matches the fix applied in the paired pgxntool-test PR (Postgres-Extensions/pgxntool-test#34). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jnasbyupgrade
marked this pull request as ready for review
July 26, 2026 21:21
jnasbyupgrade
added a commit
to Postgres-Extensions/pgxntool-test
that referenced
this pull request
Jul 26, 2026
Related pgxntool PR: Postgres-Extensions/pgxntool#70 Short version: always pull CI from `master`, for security reasons. See #34 for details.
jnasbyupgrade
merged commit Jul 26, 2026
c38cf2a
into
Postgres-Extensions:master
5 of 7 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.
actions/checkoutrefuses fork-PR checkouts underpull_request_targetunlessallow-unsafe-pr-checkout: trueis set explicitly. This broke theclaude-reviewjob's checkout step deterministically whenever its internal cost gate reacheddecision=run(see the failing run linked from #60: https://github.com/Postgres-Extensions/pgxntool/actions/runs/30218144501/job/89835769849).Check out the base branch only (drop
repository:/ref:) instead of the fork's head, rather than opting into the unsafe flag. Peranthropics/claude-code-action's own security guidance (docs/security.md), this is the preferred pattern forpull_request_target: the action reads PR content via its own GitHub token/API (already haspull-requestsread/write for posting the review) rather than needing the fork's files checked out locally.This keeps
pull_request_target(needed for fork PRs to accessCLAUDE_CODE_OAUTH_TOKEN— plainpull_requestwithholds secrets from fork-triggered runs, per the existing comment in this file). Becausepull_request_targetalways runs the workflow file from the base branch, this specific check can't turn green on its own PR — it will only start passing on PRs opened after this merges.Related pgxntool-test PR: Postgres-Extensions/pgxntool-test#34