From 191fab06004ad5784c28cf2ba2b18f6d163a860d Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Mon, 17 Feb 2025 03:46:20 +0100 Subject: [PATCH] Don't allow concurrent runs of scheduled + interactive workflows ... deploying to same URL --- .github/workflows/ci.yaml | 1 + .github/workflows/deploy.yaml | 2 +- .github/workflows/interactive.yaml | 9 +++++---- .github/workflows/scheduled.yaml | 9 +++++---- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ed9a372c..3c1d2cb2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,6 +16,7 @@ env: DEBS_PATH: ${{ vars.DEBS_PATH || '~/debs' }} TERM: xterm # needed for colored output of unittests +# New workflow run replaces previous one concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index ea6dffcd..9f4284bb 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -71,7 +71,7 @@ env: concurrency: # Ensure exclusive access to deployment target - group: ${{ inputs.DEPLOY_URL || vars.DEPLOY_URL }} + group: deploy-to-${{ inputs.DEPLOY_URL || vars.DEPLOY_URL }} cancel-in-progress: false jobs: diff --git a/.github/workflows/interactive.yaml b/.github/workflows/interactive.yaml index d5685609..84a186cc 100644 --- a/.github/workflows/interactive.yaml +++ b/.github/workflows/interactive.yaml @@ -61,6 +61,11 @@ on: description: Incrementally fill chroot? required: false +# Don't allow concurrent runs of workflows deploying to same target +concurrency: + group: build-and-deploy-to-${{ vars.DEPLOY_URL }} + cancel-in-progress: false + jobs: stage-1: uses: ./.github/workflows/build.yaml @@ -137,10 +142,6 @@ jobs: if: success() && vars.DEPLOY_URL timeout-minutes: 15 runs-on: ubuntu-latest - concurrency: - # Ensure exclusive access to deployment target - group: ${{ vars.DEPLOY_URL }} - cancel-in-progress: false steps: - uses: actions/checkout@v4 - name: Import build artifacts to reprepro server diff --git a/.github/workflows/scheduled.yaml b/.github/workflows/scheduled.yaml index bf9781e4..4efcf6c9 100644 --- a/.github/workflows/scheduled.yaml +++ b/.github/workflows/scheduled.yaml @@ -7,6 +7,11 @@ on: - cron: "0 20 * * *" +# Don't allow concurrent runs of workflows deploying to same target +concurrency: + group: build-and-deploy-to-${{ vars.DEPLOY_URL }} + cancel-in-progress: false + jobs: build: strategy: @@ -37,10 +42,6 @@ jobs: if: always() && vars.DEPLOY_URL timeout-minutes: 15 runs-on: ubuntu-latest - concurrency: - # Ensure exclusive access to deployment target - group: ${{ vars.DEPLOY_URL }} - cancel-in-progress: false steps: - uses: actions/checkout@v4 - name: Import build artifacts to reprepro server