Skip to content

Commit 5b341d3

Browse files
authored
Restrict trigger push branch for GitHub Workflow (#1619)
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 21b5299 commit 5b341d3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/dev.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
# under the License.
1717

1818
name: Dev
19-
on: [push, pull_request]
19+
on:
20+
push:
21+
branches:
22+
- main
23+
- branch-*
24+
pull_request:
2025

2126
jobs:
2227

0 commit comments

Comments
 (0)