Skip to content

Commit fcdb530

Browse files
apupierok2c
authored andcommitted
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 c73e499 commit fcdb530

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/maven.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515

1616
name: Java CI
1717

18-
on: [push, pull_request]
18+
on:
19+
push:
20+
branches:
21+
- master
22+
- 5.4.x
23+
pull_request:
1924

2025
permissions:
2126
contents: read

0 commit comments

Comments
 (0)