From e82429c273623f105bbe929a4e251abbaa4cf49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Wed, 1 Jul 2026 14:42:58 +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/build.yml | 8 ++++++-- .github/workflows/ci.yml | 8 ++++++-- .github/workflows/rat.yml | 8 ++++++-- .github/workflows/ui.yml | 8 +++++++- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62b816719c7b..9c8ca10f85e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,8 +17,12 @@ name: Build on: - - push - - pull_request + push: + branches: + - main + - 4.22 + - 4.20 + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63484def8f9b..7f6645f4af4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,12 @@ name: Simulator CI on: - - push - - pull_request + push: + branches: + - main + - 4.22 + - 4.20 + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} diff --git a/.github/workflows/rat.yml b/.github/workflows/rat.yml index f8b0aa149324..b75ff42b9122 100644 --- a/.github/workflows/rat.yml +++ b/.github/workflows/rat.yml @@ -17,8 +17,12 @@ name: License Check on: - - push - - pull_request + push: + branches: + - main + - 4.22 + - 4.20 + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml index aeccb5624f72..7f23add660f0 100644 --- a/.github/workflows/ui.yml +++ b/.github/workflows/ui.yml @@ -17,7 +17,13 @@ name: UI Build -on: [push, pull_request] +on: + push: + branches: + - main + - 4.22 + - 4.20 + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}