From cba412e32ea92de6dc917361ba4721768be620ac Mon Sep 17 00:00:00 2001 From: Alejandro Lazaro Date: Sat, 2 Mar 2024 02:02:51 +0100 Subject: [PATCH] feat: add concurrency to workflow Allow only one workflow at that time. If a second workflow is triggered, it will be put in pending state, and only start once the first workflow finish. If the workflow is triggered a third time while the first one is running, the second workflow is canceled, and the third takes over the pending state. Fix #163. Signed-off-by: Alejandro Lazaro --- .github/workflows/bump-and-publish-versions-prod.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-and-publish-versions-prod.yml b/.github/workflows/bump-and-publish-versions-prod.yml index 6c6c65eec5..0fba230b92 100644 --- a/.github/workflows/bump-and-publish-versions-prod.yml +++ b/.github/workflows/bump-and-publish-versions-prod.yml @@ -5,6 +5,9 @@ on: - cron: '5 * * * *' workflow_dispatch: +concurrency: + group: ${{ github.head_ref }} + jobs: bump-versions: uses: opentofu/registry/.github/workflows/bump-versions.yml@main @@ -17,4 +20,4 @@ jobs: uses: opentofu/registry/.github/workflows/generate-and-deploy.yml@main secrets: inherit with: - environment: "Production" \ No newline at end of file + environment: "Production"