From c3d7f67d08d84ea273719fa0b315acde87f386f3 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Wed, 22 Dec 2021 19:03:23 -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 | 9 +++++---- .github/workflows/fossa.yml | 8 ++++---- .github/workflows/lint.yml | 8 ++++---- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa2b5569..fffd7cb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,10 @@ on: env: DOCKER_BUILDKIT: 1 +concurrency: + group: ${{ github.ref_name }}-ci + cancel-in-progress: true + jobs: vars: @@ -37,10 +41,6 @@ jobs: git_tag: ${{ steps.vars.outputs.git_tag }} repo_name: ${{ steps.vars.outputs.repo }} 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: Output Variables diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6e4d0155..4cafbf9a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -9,6 +9,10 @@ on: schedule: - cron: '45 2 * * 4' +concurrency: + group: ${{ github.ref_name }}-codeql + cancel-in-progress: true + jobs: analyze: name: Analyze @@ -23,10 +27,6 @@ jobs: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 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 89026296..9bc8bc45 100644 --- a/.github/workflows/dockerhub-description.yml +++ b/.github/workflows/dockerhub-description.yml @@ -6,14 +6,15 @@ on: paths: - README.md - .github/workflows/dockerhub-description.yml + +concurrency: + group: ${{ github.ref_name }}-dockerhub-description + 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 9f44e0b1..d60f4143 100644 --- a/.github/workflows/fossa.yml +++ b/.github/workflows/fossa.yml @@ -8,16 +8,16 @@ on: - '**.md' - 'LICENSE' +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 81d4c925..8189dce8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,6 +17,10 @@ defaults: run: shell: bash +concurrency: + group: ${{ github.ref_name }}-lint + cancel-in-progress: true + env: GOLANGCI_TIMEOUT: 10m0s @@ -26,10 +30,6 @@ jobs: 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