From 7873e6c4500d5a9b8426780f955409a5d8813860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20J=C3=B3nsson?= Date: Fri, 10 Nov 2023 19:46:08 +0000 Subject: [PATCH] Use GitHub actions concurrency to cancel in progress workflows on PRs (#1232) --- .github/workflows/test.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f81e00883..f2fee2f8d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,13 +1,16 @@ name: test on: pull_request + +# Cancel in progress workflows on pull_requests. +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest steps: - - name: Cancel running workflows - uses: styfle/cancel-workflow-action@0.12.0 - with: - access_token: ${{ github.token }} - name: Checkout repo uses: actions/checkout@v4 - name: Set node version