From f5d8fb6fc34aaf204028023e4c7bea5a317af526 Mon Sep 17 00:00:00 2001 From: Amisha Singla Date: Fri, 26 Jul 2024 14:15:34 -0500 Subject: [PATCH] Set concurrency to cancel old workflow runs --- .github/workflows/ci-cd-dev.yml | 4 ++++ .github/workflows/deploy.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/ci-cd-dev.yml b/.github/workflows/ci-cd-dev.yml index 804700fa..38b81ef3 100644 --- a/.github/workflows/ci-cd-dev.yml +++ b/.github/workflows/ci-cd-dev.yml @@ -10,6 +10,10 @@ on: branches: - master +concurrency: + group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }} + cancel-in-progress: true + jobs: pre-commit: runs-on: ubuntu-latest diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index aaf75150..9710b902 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,6 +12,10 @@ on: - dev - prod +concurrency: + group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }} + cancel-in-progress: true + jobs: tests: runs-on: ubuntu-latest