From 4b3bd12d61922fe202d38eda78b5b604e23d594c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Thu, 2 Jul 2026 09:27:45 +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/maven.yml | 3 +++ .github/workflows/maven_crosstest.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index b075472b3..d6926cb04 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -27,6 +27,9 @@ on: # allow direct trigger workflow_dispatch: push: + branches: + - master + - release paths-ignore: - '**/workflows/*.yml' - 'src/docker/*' diff --git a/.github/workflows/maven_crosstest.yml b/.github/workflows/maven_crosstest.yml index 16e7d3a85..c9eb5dd1b 100644 --- a/.github/workflows/maven_crosstest.yml +++ b/.github/workflows/maven_crosstest.yml @@ -23,6 +23,9 @@ on: # allow direct trigger workflow_dispatch: push: + branches: + - master + - release paths: - '**/native/**' - 'Makefile*'