Skip to content

Restrict trigger push branch for GitHub Workflow#3641

Merged
Fokko merged 1 commit into
apache:masterfrom
apupier:configureTriggerPushForGitHubAction
Jul 5, 2026
Merged

Restrict trigger push branch for GitHub Workflow#3641
Fokko merged 1 commit into
apache:masterfrom
apupier:configureTriggerPushForGitHubAction

Conversation

@apupier

@apupier apupier commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Feature branches rarely need their own CI runs: the code is already tested when a pull request is opened against a release branch. If the push trigger has no branch restriction and pull_request is also configured, every push to a branch with an open PR runs the workflow twice: once for the push and once for the PR synchronisation.

Always give the push trigger an explicit list of branches: this stops branches created from a release branch from inheriting its workflow runs.

see https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=430408443#GitHubActionsRecommendedPractices-Restrictthepushtriggertospecificbranches

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Feature branches rarely need their own CI runs: the code is already
tested when a pull request is opened against a release branch. If the
push trigger has no branch restriction and pull_request is also
configured, every push to a branch with an open PR runs the workflow
twice: once for the push and once for the PR synchronisation.

Always give the push trigger an explicit list of branches: this stops
branches created from a release branch from inheriting its workflow
runs.

see https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=430408443#GitHubActionsRecommendedPractices-Restrictthepushtriggertospecificbranches

Signed-off-by: Aurélien Pupier <apupier@ibm.com>

@wgtmac wgtmac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems reasonable.

@Fokko Fokko merged commit 053a851 into apache:master Jul 5, 2026
3 checks passed
@Fokko

Fokko commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Makes sense, thanks @apupier for fixing this, and @wgtmac for the review 👍

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.

3 participants