From 15358a3b3d81b26574b167c1ab77d9444f7ecbda Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Mon, 29 Nov 2021 22:10:04 -0800 Subject: [PATCH] Use concurrency groups to cancel running workflows --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/codeql-analysis.yml | 8 ++++---- .github/workflows/dockerhub-description.yml | 10 ++++++---- .github/workflows/fossa.yml | 8 ++++---- .github/workflows/lint.yml | 8 ++++---- .github/workflows/sync.yml | 8 ++++---- .github/workflows/update-docker-images.yml | 4 ++++ 7 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7509f7189f..d5b88635e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,10 @@ env: GIT_NAME: NGINX Kubernetes Team GIT_MAIL: kubernetes@nginx.com +concurrency: + group: ${{ github.ref_name }}-ci + cancel-in-progress: true + jobs: checks: @@ -44,10 +48,6 @@ jobs: go_version: ${{ steps.vars.outputs.go_version }} go_path: ${{ steps.go.outputs.go_path }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout Repository uses: actions/checkout@v2 - name: Cache Go controller tools diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7522f91951..b1c683ed52 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -9,6 +9,10 @@ on: schedule: - cron: '36 6 * * 4' +concurrency: + group: ${{ github.ref_name }}-codeql + cancel-in-progress: true + jobs: analyze: name: Analyze @@ -20,10 +24,6 @@ jobs: language: [ 'go', 'python' ] steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout repository uses: actions/checkout@v2 diff --git a/.github/workflows/dockerhub-description.yml b/.github/workflows/dockerhub-description.yml index fedcdad5ba..43e70079f6 100644 --- a/.github/workflows/dockerhub-description.yml +++ b/.github/workflows/dockerhub-description.yml @@ -6,14 +6,16 @@ on: paths: - README.md - .github/workflows/dockerhub-description.yml + +concurrency: + group: ${{ github.ref_name }}-dockerhub + cancel-in-progress: true + + jobs: dockerHubDescription: runs-on: ubuntu-20.04 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/checkout@v2 - name: Modify readme for DockerHub diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml index 8064d4d3e1..4afc75c67a 100644 --- a/.github/workflows/fossa.yml +++ b/.github/workflows/fossa.yml @@ -9,16 +9,16 @@ on: - 'examples/**' - '**.md' +concurrency: + group: ${{ github.ref_name }}-fossa + cancel-in-progress: true + jobs: scan: name: Fossa runs-on: ubuntu-20.04 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout Repository uses: actions/checkout@v2 - name: Scan diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7f94998fe6..9c1647c8c6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,16 +20,16 @@ defaults: env: GOLANGCI_TIMEOUT: 10m0s +concurrency: + group: ${{ github.ref_name }}-lint + cancel-in-progress: true + jobs: lint: name: Lint runs-on: ubuntu-20.04 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout Repository uses: actions/checkout@v2 - name: Lint Code diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 8c1dbc58a5..884cb5072e 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -8,15 +8,15 @@ on: types: - completed +concurrency: + group: ${{ github.ref_name }}-sync + cancel-in-progress: true + jobs: # This job sync this repo to our internal repo repo-sync: runs-on: ubuntu-20.04 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - name: Repo Sync uses: wei/git-sync@v3 with: diff --git a/.github/workflows/update-docker-images.yml b/.github/workflows/update-docker-images.yml index 51563086f1..61f9461d3a 100644 --- a/.github/workflows/update-docker-images.yml +++ b/.github/workflows/update-docker-images.yml @@ -13,6 +13,10 @@ env: DOCKER_BUILDKIT: 1 K8S_TIMEOUT: 75s +concurrency: + group: ${{ github.ref_name }}-update + cancel-in-progress: true + jobs: variables: