Skip to content

Commit 45648d5

Browse files
committed
Restrict trigger push branch for GitHub Workflow
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>
1 parent 9021ef4 commit 45648d5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

.github/workflows/maven.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ name: GitHub CI
1919

2020
on:
2121
push:
22+
branches:
23+
- master
2224
# branches-ignore:
2325
# - dependabot/**
2426
pull_request:

0 commit comments

Comments
 (0)