From 5167a6933ef6119493cd75ad566f338182999d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Thu, 2 Jul 2026 09:13:14 +0200 Subject: [PATCH] Restrict trigger push branch for GitHub Workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/coverage.yml | 2 ++ .github/workflows/maven.yml | 2 ++ .github/workflows/maven_legacy.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fff1719e9..f818bfe48 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -20,6 +20,8 @@ on: workflow_dispatch: # Don't trigger if other workfiles change push: + branches: + - master paths-ignore: - '**/workflows/*.yml' - '!**/workflows/coverage.yml' diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e14eeac64..c341f91b8 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -20,6 +20,8 @@ on: workflow_dispatch: # Don't trigger if other workfiles change push: + branches: + - master paths-ignore: - '**/workflows/*.yml' - '!**/workflows/maven.yml' diff --git a/.github/workflows/maven_legacy.yml b/.github/workflows/maven_legacy.yml index 59e4e7817..5d83296cc 100644 --- a/.github/workflows/maven_legacy.yml +++ b/.github/workflows/maven_legacy.yml @@ -20,6 +20,8 @@ on: workflow_dispatch: # self trigger push: + branches: + - master paths: - '**/workflows/maven_legacy.yml' - 'commons-math-legacy/**'