fix(ci): opt in fork PR checkout for Codex review (#1107)

GitHub's 2026-07-20 actions/checkout backport refuses fork PR refs under
pull_request_target unless allow-unsafe-pr-checkout is set. HAPI Bot needs
the merge ref plus base-repo secrets; this restores fork contributor reviews.

Co-authored-by: Debian <heavygee@oos-linux.in.lockhouse>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
HeavyGee
2026-07-22 09:19:17 +08:00
committed by GitHub
co-authored by Debian Cursor
parent 3dd425b15c
commit a9115715f8
+4
View File
@@ -85,12 +85,16 @@ jobs:
env:
HAPI_BOT_LOGINS: ${{ vars.HAPI_BOT_LOGINS }}
# Codex reviews the PR merge ref under pull_request_target (needs base-repo
# secrets). GitHub's 2026-07-20 checkout backport refuses fork PR checkouts
# here unless explicitly opted in: https://github.blog/changelog/2026-06-18-safer-pull_request_target-defaults-for-github-actions-checkout/
- name: Checkout repository
if: steps.check_bot.outputs.has_review_for_current_head != 'true'
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
fetch-depth: 0
allow-unsafe-pr-checkout: true
- name: Pre-fetch base and head refs
if: steps.check_bot.outputs.has_review_for_current_head != 'true'