From 43201a4ad873e9ae581fcfbbcc26d4fb0595046e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Wed, 1 Jul 2026 14:36:04 +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/code-checks.yml | 7 ++++++- .github/workflows/lfs-warning.yml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index ac368fcf6a2197..6a29219f21bc9e 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -17,7 +17,12 @@ name: Code Checks -on: [push, pull_request_target] +on: + push: + branches: + - master + - branch-* + pull_request_target: jobs: shellcheck: diff --git a/.github/workflows/lfs-warning.yml b/.github/workflows/lfs-warning.yml index 4db79ceded9eea..28080d4b63821e 100644 --- a/.github/workflows/lfs-warning.yml +++ b/.github/workflows/lfs-warning.yml @@ -18,7 +18,12 @@ --- name: 'Check Large File' -on: [push, pull_request_target] +on: + push: + branches: + - master + - branch-* + pull_request_target: jobs: large-file-checker: