ci: run pull-request checks for every base branch (#7545)

Stacked PRs and PRs into next got no CI because the pull_request trigger
was limited to main. Drop the base filter from CI and desktop packaging,
and lock it with a workflow contract test.
This commit is contained in:
Mohamed Boudra
2026-10-21 13:32:10 +07:00
committed by GitHub
parent 77453388e4
commit 98d34a3dc1
4 changed files with 18 additions and 6 deletions
+13 -1
View File
@@ -105,6 +105,18 @@ test("gated checks are statically named jobs with real job-level gating", () =>
}
});
test("pull-request checks run for every base branch, including stacked PRs", () => {
for (const workflowPath of [
ciWorkflowPath,
new URL(".github/workflows/desktop-packages.yml", repoRoot),
]) {
const trigger = readFileSync(workflowPath, "utf8").split("jobs:", 1)[0];
const pullRequest = trigger.match(/^ pull_request:\n((?: .*\n)*)/m);
assert.ok(pullRequest, `${workflowPath.pathname} runs on pull requests`);
assert.doesNotMatch(pullRequest[1], /branches/);
}
});
test("change gating allows superseded workflow runs to cancel", () => {
const ci = readFileSync(ciWorkflowPath, "utf8");
assert.match(
@@ -308,7 +320,7 @@ test("desktop packaging smokes main pushes and only the pull requests that touch
const source = readFileSync(new URL(".github/workflows/desktop-packages.yml", repoRoot), "utf8");
const trigger = source.split("jobs:", 1)[0];
assert.match(trigger, /push:\s*\n\s+branches: \[main\]/);
assert.match(trigger, /pull_request:\s*\n\s+branches: \[main\]\s*\n\s+paths:/);
assert.match(trigger, /pull_request:\s*\n\s+paths:/);
assert.match(trigger, /- "packages\/desktop\/\*\*"/);
assert.doesNotMatch(source, /dorny\/paths-filter/);
for (const action of ["actions/checkout", "actions/setup-node", "actions/upload-artifact"]) {