ci: run required checks on merge-queue groups (#11297)

* ci: run required checks on merge-queue groups

Add the merge_group trigger to CI and PR title validation so every required
check reports on the queued group's exact head. Group runs use exact-head
concurrency groups that pushes cannot cancel, classify the group's combined
diff from its base (a non-ancestor base fails planning), and keep the CI
required gate running when a group is cancelled so it fails instead of
reporting a skipped check. Title validation checks every squash commit
subject between the group base and head.

* ci: read the merge-group comparison from a file
This commit is contained in:
morluto authored and GitHub committed 2026-11-15 11:29:13 -05:00
1 parent 28e95f34d0
commit 5efaedda88
9 files changed
+328 -34

No files matched your search

+20 -2
View File
@@ -172,7 +172,13 @@ export function planChanges(request, repository) {
const { event } = request;
if (
!["pull_request", "push", "schedule", "workflow_dispatch"].includes(event)
![
"pull_request",
"push",
"merge_group",
"schedule",
"workflow_dispatch",
].includes(event)
)
throw new Error(`Unsupported CI event: ${event}`);
const requestedFull =
@@ -297,11 +303,23 @@ export function planChanges(request, repository) {
);
} else if (tier === "full") {
full("Full baseline requested by event or ci:full label");
} else if (event === "pull_request" || event === "push") {
} else {
// Fast pull_request, push and merge_group plans diff an exact base.
const { head } = request;
let base;
if (event === "pull_request") {
base = repository.mergeBase(request.base, head);
} else if (event === "merge_group") {
// The queue builds a group on its base, so every queued change lies
// between that base and the group head. Anything else fails planning
// rather than narrowing the lanes a queued batch must pass.
const candidate = request.base ?? "";
if (
!/^[0-9a-f]{40}$/i.test(candidate) ||
!repository.isAncestor(candidate, head)
)
throw new Error("Merge group base must be an ancestor of its head");
base = candidate;
} else {
const candidate = request.base;
const { baselineReason } = request;