Restrict Build CI push trigger to main and *.x#11046
Open
dhalbert wants to merge 1 commit into
Open
Conversation
Limit Build CI push runs to main and maintenance branches. This avoids duplicate board builds for same-repo pull requests, where both push and pull_request events currently run the same workflow. It also avoids duplicate release builds, where publishing a release currently triggers both a tag push run and a release run for the same SHA. Fork pull requests continue to work because upstream CI still runs on pull_request; only the upstream push trigger is narrowed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR narrows the Build CI workflow’s push trigger so it only runs for main and maintenance branches (*.x), preventing duplicate CI runs for the same SHA when both push + pull_request (and push + release) events would otherwise fire.
Changes:
- Restrict
on: pushtomainand*.xbranches. - Keep
pull_requestandrelease: publishedtriggers unchanged.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
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.
This PR was written by Copilot, not me.
Summary
Build CIpush runs tomainand*.xpull_requestandreleasebehavior unchangedWhy
Build CIcurrently runs on bothpushandpull_request.For a PR branch in
adafruit/circuitpython, the same commits generate both events in the upstream repo, so the board matrix runs twice. Fork PRs do not have this problem in the upstream repo because the fork push happens in the fork, while the upstream repo only runs thepull_requestworkflow.Releases currently duplicate as well: publishing a release triggers the
releaseevent, and the associated tag push also triggerspush, producing twoBuild CIruns for the same SHA.Restricting
pushtomainand maintenance branches fixes both cases while preserving branch-push CI where it is most useful.Effect on fork PRs
Regular PR builds from forks still work normally. The upstream repo still runs this workflow on
pull_request; this change only narrows which upstreampushevents trigger it.Release behavior
Release-specific behavior still works because the workflow continues to run on
release: published, and the publish/upload steps already key off release events.