From 2745323ec862829820a805747ff66da0566f5fa9 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Tue, 24 Jan 2023 18:04:47 +0100 Subject: [PATCH] tools: github actions: prevent multiple concurrent workflow runs on the same branch/ref - cancel other pending/in-progress workflows if a new commit is pushed to the ref - ref. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency --- .github/workflows/ci.yml | 4 ++++ .github/workflows/update-metadata.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4d35ed96e..65cd6e0820 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,10 @@ on: branches: [ master ] workflow_dispatch: +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: ci: runs-on: ubuntu-latest diff --git a/.github/workflows/update-metadata.yml b/.github/workflows/update-metadata.yml index 5ced39267f..d51e1f2149 100644 --- a/.github/workflows/update-metadata.yml +++ b/.github/workflows/update-metadata.yml @@ -5,6 +5,10 @@ on: env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: test_schedule: runs-on: ubuntu-latest