Skip to content

Restrict Build CI push trigger to main and *.x#11046

Open
dhalbert wants to merge 1 commit into
adafruit:mainfrom
dhalbert:ci-limit-build-push-branches
Open

Restrict Build CI push trigger to main and *.x#11046
dhalbert wants to merge 1 commit into
adafruit:mainfrom
dhalbert:ci-limit-build-push-branches

Conversation

@dhalbert
Copy link
Copy Markdown
Collaborator

@dhalbert dhalbert commented Jun 4, 2026

This PR was written by Copilot, not me.

Summary

  • limit Build CI push runs to main and *.x
  • keep pull_request and release behavior unchanged
  • avoid duplicate board and release builds triggered from the same SHA

Why

Build CI currently runs on both push and pull_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 the pull_request workflow.

Releases currently duplicate as well: publishing a release triggers the release event, and the associated tag push also triggers push, producing two Build CI runs for the same SHA.

Restricting push to main and 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 upstream push events 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.

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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: push to main and *.x branches.
  • Keep pull_request and release: published triggers unchanged.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dhalbert
Copy link
Copy Markdown
Collaborator Author

dhalbert commented Jun 5, 2026

@tannewt This is only failing because #11045 hasn't been merged yet.

@dhalbert dhalbert requested a review from tannewt June 5, 2026 11:51
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