Restrict CI push triggers to main and release branches - #6837
Open
rhcarvalho wants to merge 1 commit into
Open
Conversation
Previously, the CI workflow triggered on all pushes (`[push, pull_request]`). When maintainers push feature branches directly to the upstream repository and open a pull request, GitHub Actions triggers two concurrent workflow runs for every commit, doubling CI runner consumption. This restricts the `push` event to `main` and `"v*.*"`, matching `.github/workflows/assets.yml`: - PRs continue to trigger CI via `pull_request` (exactly once per update). - Direct pushes and merges to `main` or release maintenance branches continue to run full CI. - Pushing feature branches to the repository no longer duplicates CI runs.
Member
|
I looked into this in the past and there's an open discussion here as well: https://github.com/orgs/community/discussions/26276 The problem with this approach is that it prevents CI from running on custom branches, for example when I directly push to 1.8 I still want CI to run, so this is not the way to go. Since it only affects maintainers, I learned to ignore it. |
Contributor
Author
We can configure any branch pattern. The config I'm proposing here would run on pushes to |
Member
|
Right, bad example on my side. I also want it to run on any other branch without me having to open a pull request 😅 |
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.
Previously, the CI workflow triggered on all pushes (
[push, pull_request]). When maintainers push feature branches directly to the upstream repository and open a pull request, GitHub Actions triggers two concurrent workflow runs for every commit, doubling CI runner consumption.This restricts the
pushevent tomainand"v*.*", matching.github/workflows/assets.yml:pull_request(exactly once per update).mainor release maintenance branches continue to run full CI.Addresses #6834 (comment)