Skip to content

ci: allow merged fork subject checkout - #443

Merged
Ariznawlll merged 2 commits into
mainfrom
codex/fork-merge-checkout
Sep 2, 2026
Merged

ci: allow merged fork subject checkout#443
Ariznawlll merged 2 commits into
mainfrom
codex/fork-merge-checkout

Conversation

@Ariznawlll

Copy link
Copy Markdown
Collaborator

What changed

  • Allow actions/checkout@v6 to check out the exact merged subject for fork-originated PRs.
  • Scope the opt-in to the three MatrixOne checkouts bound to the merge/verified SHA.
  • Extend the existing mergerun subject contract tests to require the merged-only guard and exact opt-in inventory.

Why

actions/checkout@v6 now rejects a customized merge_commit_sha from a fork-originated pull_request_target event unless allow-unsafe-pr-checkout is explicitly enabled. MatrixOne run 33566831590 therefore failed before the Docker build and skipped all downstream tests.

The build job already requires github.event.pull_request.merged == true, and the workflow continues to verify that the checked-out HEAD equals merge_commit_sha. This preserves PR #441's exact merged-subject behavior for release branches.

Verification

  • python3 scripts/test_merge_trigger_tke_subject.py -v (5 tests passed)
  • YAML parse and merged-subject invariant assertions
  • actionlint v1.7.12

@LeftHandCold LeftHandCold left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head d993817cd39a10ed1ae2412c48dbcbc1b243e3f5.

The runtime/security direction is correct: checkout v6 now requires this explicit opt-in for fork-originated pull_request_target subjects, while this reusable workflow admits only an already-merged PR, verifies the exact 40-hex merge SHA, and passes that verified immutable SHA to the two downstream MatrixOne checkouts. The added contract tests cover the intended inventory and merged-only guard.

One objective delivery blocker remains. The repository pins actionlint v1.7.12, released before allow-unsafe-pr-checkout was backported to checkout v6, so its embedded action schema rejects all three new inputs. The exact-head required check fails before the subject-contract tests run. Please align the repository validator with the current checkout v6 metadata (or add a narrowly scoped temporary ignore for this exact input/file) and rerun the required workflow green. I found no other security, subject-identity, or workflow-control blocker.

Comment thread .github/workflows/merge-trigger-tke.yaml

@LeftHandCold LeftHandCold left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed exact head 3dc1e162164894bdcef48057defc37059197fddc.

The prior delivery blocker is closed. Since actionlint v1.7.12 is still the latest release and predates checkout v6's new input, the added workaround is appropriately narrow: it is scoped only to .github/workflows/merge-trigger-tke.yaml and matches only the exact allow-unsafe-pr-checkout diagnostic for actions/checkout@v6.

The exact-head required run 33606369688 is green: the full actionlint invocation passed, then all five merged-subject contract tests ran and passed. The production workflow remains limited to merged PRs, verifies the immutable merge SHA, and carries only that verified SHA into the two downstream MatrixOne checkouts. No remaining security, correctness, workflow-control, or delivery blocker found.

@Ariznawlll
Ariznawlll merged commit 99d3fea into main Sep 2, 2026
1 check passed
@Ariznawlll
Ariznawlll deleted the codex/fork-merge-checkout branch September 2, 2026 08:13
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.

2 participants