This is an automated email from the ASF dual-hosted git repository.

sebbASF pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-weaver.git


The following commit(s) were added to refs/heads/master by this push:
     new f010ef3  Restrict trigger push branch for GitHub Workflow (#83)
f010ef3 is described below

commit f010ef38880eddbc1dccfa7c48881801eab8a790
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Wed Dec 2 16:57:02 2026 +0100

    Restrict trigger push branch for GitHub Workflow (#83)
    
    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 <[email protected]>
---
 .github/workflows/maven.yml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 4f0ea33..c2f8d86 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -15,7 +15,12 @@
 
 name: Java CI
 
-on: [push, pull_request, workflow_dispatch]
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+  workflow_dispatch:
 
 permissions:
   contents: read

Reply via email to