From f267ebfe80861e2fb93823777f40a908fd3ea414 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Fri, 4 Mar 2022 23:18:33 +0530 Subject: [PATCH 1/2] workflow: ensure a single job in running at a time Co-authored-by: Thassio Victor Signed-off-by: Debdut Chakraborty --- .github/workflows/build_and_test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d36c3db91825..37f67fb7805c 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -9,6 +9,10 @@ on: branches: - develop +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + env: CI: true MONGO_URL: mongodb://localhost:27017 From fcd200e09014bd490f0b693fc2d7acc4bf46e025 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Wed, 9 Mar 2022 03:09:13 +0530 Subject: [PATCH 2/2] Use unique run id if no head_ref (not a pr) --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 37f67fb7805c..982809fed6a9 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -10,7 +10,7 @@ on: - develop concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: