From 6daebdb06a26b1115889bc2a4d2d8c0bc8d964a7 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Fri, 11 Aug 2023 10:09:44 -0400 Subject: [PATCH] cancel older redundant builds on the same branch --- .github/workflows/codeql.yml | 5 +++++ .github/workflows/golangci-lint.yml | 5 +++++ .github/workflows/jenkins-nightly-smoketest.yml | 5 +++++ .github/workflows/jenkins-smoketest.yml | 5 +++++ .github/workflows/main.yml | 5 +++++ .github/workflows/publish-docker-images.yml | 5 +++++ .github/workflows/push-quickstart.yml | 6 ++++++ 7 files changed, 36 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 59726cc9f..9a678153a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,6 +17,11 @@ on: schedule: - cron: '36 20 * * 3' +# cancel older, redundant runs of same workflow on same branch +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: analyze: name: Analyze diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 86b714d3a..3188b338a 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -6,6 +6,11 @@ permissions: # Optional: allow read access to pull request. Use with `only-new-issues` option. # pull-requests: read +# cancel older, redundant runs of same workflow on same branch +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: golangci: name: lint diff --git a/.github/workflows/jenkins-nightly-smoketest.yml b/.github/workflows/jenkins-nightly-smoketest.yml index d23d44e4e..360399473 100644 --- a/.github/workflows/jenkins-nightly-smoketest.yml +++ b/.github/workflows/jenkins-nightly-smoketest.yml @@ -5,6 +5,11 @@ on: # Runs "at minute 28 past every 0400 GMT from GitHub main branch" - cron: '28 4 * * *' +# cancel older, redundant runs of same workflow on same branch +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: jenkins-nightly-smoketest: runs-on: ubuntu-latest diff --git a/.github/workflows/jenkins-smoketest.yml b/.github/workflows/jenkins-smoketest.yml index 798971e83..ccaca3988 100644 --- a/.github/workflows/jenkins-smoketest.yml +++ b/.github/workflows/jenkins-smoketest.yml @@ -13,6 +13,11 @@ on: type: string required: false # this allows manually triggering the smoketest with the UNKNOWN version default +# cancel older, redundant runs of same workflow on same branch +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: jenkins-smoketest: runs-on: ubuntu-latest diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d9de884b8..4b5098230 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,11 @@ on: pull_request: workflow_dispatch: +# cancel older, redundant runs of same workflow on same branch +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + env: GOFLAGS: "-trimpath" GOX_OUTPUT: "release/{{.Arch}}/{{.OS}}/{{.Dir}}" diff --git a/.github/workflows/publish-docker-images.yml b/.github/workflows/publish-docker-images.yml index fc9fce4c2..13fa1e385 100644 --- a/.github/workflows/publish-docker-images.yml +++ b/.github/workflows/publish-docker-images.yml @@ -8,6 +8,11 @@ on: type: string required: true +# cancel older, redundant runs of same workflow on same branch +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: publish-docker-images: runs-on: ubuntu-latest diff --git a/.github/workflows/push-quickstart.yml b/.github/workflows/push-quickstart.yml index 9cebda1ea..4e96a8894 100644 --- a/.github/workflows/push-quickstart.yml +++ b/.github/workflows/push-quickstart.yml @@ -2,6 +2,12 @@ name: Deploy Quickstart Container on: workflow_dispatch: + +# cancel older, redundant runs of same workflow on same branch +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest