From a7444ce03dd7662445953efdc7bece3151320df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Wed, 1 Jul 2026 14:11:23 +0200 Subject: [PATCH] ci: 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/doc-lint.yml | 1 + .github/workflows/link-check.yml | 2 +- .github/workflows/lint.yml | 6 +++++- .github/workflows/push-dev-image-on-commit.yml | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/doc-lint.yml b/.github/workflows/doc-lint.yml index cab05f92c421..b37f729bb90c 100644 --- a/.github/workflows/doc-lint.yml +++ b/.github/workflows/doc-lint.yml @@ -2,6 +2,7 @@ name: Doc Lint on: push: + branches: [master, "release/**"] paths: - "docs/**" - "**/*.md" diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index a0f128e7762e..aeb3db453f95 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -7,7 +7,7 @@ name: 'Link Checker' on: workflow_dispatch: push: - # branches: [master, 'release/**'] + branches: [master, 'release/**'] paths: - '**/*.md' - '**/link-check.yml' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7eb237c8c876..da435aa7f887 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,10 @@ name: ❄️ Lint -on: [push, pull_request] +on: + push: + branches: [master, "release/**"] + pull_request: + branches: [master, "release/**"] permissions: contents: read diff --git a/.github/workflows/push-dev-image-on-commit.yml b/.github/workflows/push-dev-image-on-commit.yml index 741dd6812910..bdd66a6d7c4e 100644 --- a/.github/workflows/push-dev-image-on-commit.yml +++ b/.github/workflows/push-dev-image-on-commit.yml @@ -6,6 +6,7 @@ on: - "docs/**" - "**/*.md" push: + branches: [master, "release/**"] paths-ignore: - "docs/**" - "**/*.md"