From 56ee9c87ff3edfa4a5e8348c6b7b30536a004a73 Mon Sep 17 00:00:00 2001 From: Robert Gildein Date: Tue, 8 Sep 2026 09:16:58 +0200 Subject: [PATCH 1/2] chore(CI/CD): Enable only one run per PR (cancel previous) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add concurrency and group for all GitHub actions, the group name is composed: - github.workflow — the workflow's name: field (e.g. "Lint", "Test and Code Coverage") - github.ref — the full ref of the branch or tag that triggered the run (e.g. refs/heads/feat/my-feature, refs/pull/42/merge) Actions cancelling prior runs on new push: check-codegen, kustomize-validation, lint, test, test-gnmi, test-e2e, test-chart, reuse, size-label. Both publish-image, publish-chart are kept running, since we do not want to stop them in the middle of push step, which would leave partial state. Signed-off-by: Robert Gildein --- .github/workflows/check-codegen.yml | 4 ++++ .github/workflows/kustomize-validation.yml | 4 ++++ .github/workflows/lint.yml | 4 ++++ .github/workflows/publish-chart.yml | 4 ++++ .github/workflows/publish-image.yml | 4 ++++ .github/workflows/reuse.yaml | 4 ++++ .github/workflows/size-label.yml | 4 ++++ .github/workflows/test-chart.yml | 4 ++++ .github/workflows/test-e2e.yml | 4 ++++ .github/workflows/test-gnmi.yaml | 4 ++++ .github/workflows/test.yaml | 4 ++++ 11 files changed, 44 insertions(+) diff --git a/.github/workflows/check-codegen.yml b/.github/workflows/check-codegen.yml index 1f26cc96f..eaf5cfef0 100644 --- a/.github/workflows/check-codegen.yml +++ b/.github/workflows/check-codegen.yml @@ -11,6 +11,10 @@ on: - 'docs/**' - '**/*.md' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/kustomize-validation.yml b/.github/workflows/kustomize-validation.yml index 062610355..067c31479 100644 --- a/.github/workflows/kustomize-validation.yml +++ b/.github/workflows/kustomize-validation.yml @@ -11,6 +11,10 @@ on: - 'docs/**' - '**/*.md' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 522b87fbc..a5bd18855 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,6 +11,10 @@ on: - 'docs/**' - '**/*.md' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/publish-chart.yml b/.github/workflows/publish-chart.yml index 7fe08c5da..6dc8aa402 100644 --- a/.github/workflows/publish-chart.yml +++ b/.github/workflows/publish-chart.yml @@ -19,6 +19,10 @@ on: - 'docs/**' - '**/*.md' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + permissions: contents: read packages: write diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 3c62e2dae..e5e51bedd 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -19,6 +19,10 @@ on: - 'docs/**' - '**/*.md' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + permissions: contents: read packages: write diff --git a/.github/workflows/reuse.yaml b/.github/workflows/reuse.yaml index 14462f607..d1084e4b9 100644 --- a/.github/workflows/reuse.yaml +++ b/.github/workflows/reuse.yaml @@ -17,6 +17,10 @@ on: - 'docs/**' - '**/*.md' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/size-label.yml b/.github/workflows/size-label.yml index 549bb5957..89f22b70c 100644 --- a/.github/workflows/size-label.yml +++ b/.github/workflows/size-label.yml @@ -9,6 +9,10 @@ on: - opened - synchronize +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: pull-requests: write diff --git a/.github/workflows/test-chart.yml b/.github/workflows/test-chart.yml index ec86782e4..1e570e544 100644 --- a/.github/workflows/test-chart.yml +++ b/.github/workflows/test-chart.yml @@ -11,6 +11,10 @@ on: - 'docs/**' - '**/*.md' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 9d1987f27..4683e4b4a 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -11,6 +11,10 @@ on: - 'docs/**' - '**/*.md' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/test-gnmi.yaml b/.github/workflows/test-gnmi.yaml index 05e844599..6af9f2390 100644 --- a/.github/workflows/test-gnmi.yaml +++ b/.github/workflows/test-gnmi.yaml @@ -16,6 +16,10 @@ on: - 'Makefile' - 'test/gnmi/testdata/**/*.txtar' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 90c61ca49..e40d9727e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,6 +17,10 @@ on: - 'docs/**' - '**/*.md' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: actions: read contents: read From 9bcc3cd1c6152bdd8b635b53361f61b1039e068f Mon Sep 17 00:00:00 2001 From: Robert Gildein Date: Tue, 8 Sep 2026 17:23:06 +0200 Subject: [PATCH 2/2] disable cancle-in-progress for main branch Signed-off-by: Robert Gildein --- .github/workflows/check-codegen.yml | 2 +- .github/workflows/kustomize-validation.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/publish-chart.yml | 2 +- .github/workflows/publish-docs.yml | 2 +- .github/workflows/publish-image.yml | 3 +-- .github/workflows/reuse.yaml | 2 +- .github/workflows/size-label.yml | 2 +- .github/workflows/test-chart.yml | 2 +- .github/workflows/test-e2e.yml | 2 +- .github/workflows/test-gnmi.yaml | 3 +-- .github/workflows/test.yaml | 2 +- 12 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check-codegen.yml b/.github/workflows/check-codegen.yml index eaf5cfef0..27297a6b1 100644 --- a/.github/workflows/check-codegen.yml +++ b/.github/workflows/check-codegen.yml @@ -13,7 +13,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read diff --git a/.github/workflows/kustomize-validation.yml b/.github/workflows/kustomize-validation.yml index 067c31479..501007340 100644 --- a/.github/workflows/kustomize-validation.yml +++ b/.github/workflows/kustomize-validation.yml @@ -13,7 +13,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a5bd18855..3cd90bc69 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read diff --git a/.github/workflows/publish-chart.yml b/.github/workflows/publish-chart.yml index 6dc8aa402..15157cede 100644 --- a/.github/workflows/publish-chart.yml +++ b/.github/workflows/publish-chart.yml @@ -21,7 +21,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: false + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index cc25671e9..a61b21e51 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -13,7 +13,7 @@ on: concurrency: group: pages - cancel-in-progress: false + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index e5e51bedd..f88e4a744 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -21,7 +21,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: false + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read @@ -102,4 +102,3 @@ jobs: annotations: ${{ steps.meta.outputs.annotations }} cache-to: type=gha,mode=max cache-from: type=gha - diff --git a/.github/workflows/reuse.yaml b/.github/workflows/reuse.yaml index d1084e4b9..a53c09cbc 100644 --- a/.github/workflows/reuse.yaml +++ b/.github/workflows/reuse.yaml @@ -19,7 +19,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read diff --git a/.github/workflows/size-label.yml b/.github/workflows/size-label.yml index 89f22b70c..136a6ab0c 100644 --- a/.github/workflows/size-label.yml +++ b/.github/workflows/size-label.yml @@ -11,7 +11,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: pull-requests: write diff --git a/.github/workflows/test-chart.yml b/.github/workflows/test-chart.yml index 1e570e544..0302a039f 100644 --- a/.github/workflows/test-chart.yml +++ b/.github/workflows/test-chart.yml @@ -13,7 +13,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 4683e4b4a..54dc210da 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -13,7 +13,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read diff --git a/.github/workflows/test-gnmi.yaml b/.github/workflows/test-gnmi.yaml index 6af9f2390..d743d6714 100644 --- a/.github/workflows/test-gnmi.yaml +++ b/.github/workflows/test-gnmi.yaml @@ -18,7 +18,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read @@ -40,4 +40,3 @@ jobs: go-version-file: 'go.mod' - name: Running gNMI tests run: make test-gnmi PROVIDER=${{ matrix.provider }} GINKGO_PROCS=$(nproc) - diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e40d9727e..85e59b1ba 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,7 +19,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: actions: read