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

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


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

commit 1cee2971a201411c39e6d1606d7d7d22fad52501
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Thu Sep 17 22:29:03 2026 +0200

    Restrict trigger push branch for GitHub Workflow (#106)
    
    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 dc488cbf..67074bd9 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