From c8435364ba767a4f8e0d7ff9a5001e42819798de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Fri, 3 Jul 2026 09:23:03 +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/action-test.yml | 7 ++++++- .github/workflows/linkcheck.yml | 7 ++++++- .github/workflows/yetus.yml | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index cc49dd7da..b1e69d5d1 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -16,7 +16,12 @@ --- name: Action Test -on: [push, pull_request, workflow_dispatch] # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + workflow_dispatch: jobs: build: diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index d5149cb71..1eaea77ad 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -16,7 +16,12 @@ --- name: linkcheck -on: [push, pull_request, workflow_dispatch] # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + workflow_dispatch: # diff --git a/.github/workflows/yetus.yml b/.github/workflows/yetus.yml index 9857a1e46..a76b9a438 100644 --- a/.github/workflows/yetus.yml +++ b/.github/workflows/yetus.yml @@ -16,7 +16,12 @@ --- name: Apache Yetus -on: [push, pull_request, workflow_dispatch] # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + workflow_dispatch: permissions: statuses: write