ci: skip PR runs when targeting a non-main base branch#426
Merged
jrusso1020 merged 2 commits intomainfrom Apr 22, 2026
Merged
Conversation
Adds `branches: [main]` to the `pull_request:` trigger of each workflow that runs on PRs (CI, regression, Windows render verification, Docs, Catalog Previews). PRs whose base is something other than main — typical for stacked PRs — no longer trigger these workflows. On a 5-PR Graphite stack this turns 5× CI runs into 1× (when the tip of the stack reaches main). When a child PR is rebased/promoted so its base becomes main, CI fires as normal. publish.yml and the default CodeQL setup are untouched: publish already filters to main, and CodeQL is default-setup (org UI, not a repo YAML).
miguel-heygen
approved these changes
Apr 22, 2026
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.
What
Adds
branches: [main]to thepull_request:trigger of each workflow that runs on PRs:ci.ymlregression.ymlwindows-render.ymldocs.ymlcatalog-previews.ymlOne line added per file. PRs whose base is something other than
main(typical for stacked PRs targeting another feature branch) no longer trigger these workflows.Why
CI usage was saturated earlier today — partly from ~14 simultaneously-active Vance branches, partly from the general pattern of Graphite-stacked PRs triggering the full matrix (
styles-a..g,fast,render-compat,hdr, Windows render, CodeQL) once per level of the stack. On a 5-PR stack that's 5× the CI work, most of which is redundant: once the bottom of the stack merges, the next PR rebases tomainand re-runs anyway.After this change:
mainmainpushtomainPaired with #425 (concurrency groups), this should take a meaningful bite out of the hosted-runner contention we saw this afternoon.
Tradeoffs
maintemporarily, or push changes to an ancestor to force the stack to merge-down.concurrency:groups from ci(regression): add concurrency group to cancel superseded runs #425 already cancel superseded runs within a single branch — so the combination is "cancel wasted runs on the same branch" + "don't open runs on stacked bases in the first place."Not touched
publish.yml— already filters tobranches: [main]on thepull_request: types: [closed]trigger.Test plan
+ branches: [main]in one place per file), YAML is valid (lefthook format check passed), andbranches:filtering onpull_request:is a standard GitHub Actions feature with documented semantics: https://docs.github.com/en/actions/writing-workflows/choosing-when-workflows-run/triggering-a-workflow#running-your-pull_request-workflow-based-on-the-head-or-base-branch-of-a-pull-requestOnce merged: the next stacked PR anyone opens (base ≠
main) should skip CI. A subsequent rebase tomainwill re-fire CI as expected.