From bc515b0cc3af6584e0e8a2e6f4623bb25edcae9a Mon Sep 17 00:00:00 2001 From: ColorfulRhino <131405023+ColorfulRhino@users.noreply.github.com> Date: Sat, 8 Jun 2024 12:14:54 +0200 Subject: [PATCH] actions: Move concurrency canceling to 2nd job for PR build On every PR, a workflow is started to check if artifacts should be built. This happens not only once, but many times, e.g. for every selected reviewer. Since the workflow has `cancel-in-progress` enabled, workflows are started and immediately cancelled by the next one, resulting in many notifications. Move the `cancel-in-progress` concurrency policy to the second job which starts only after a check is done if the 'Build' label is even active on the PR. This should greatly reduce "Workflow cancelled" notifications via GitHub and email (if enabled by the user). Also make wording more clear. --- .github/workflows/build-artifacts-pr.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-artifacts-pr.yml b/.github/workflows/build-artifacts-pr.yml index 975aa4f8d7..b7cec99dfb 100644 --- a/.github/workflows/build-artifacts-pr.yml +++ b/.github/workflows/build-artifacts-pr.yml @@ -1,23 +1,19 @@ -name: Generate artifacts on PR +name: Generate artifacts on PR if 'Build' label exists # -# If PR is labeled with "Build" and you are a member of "Release manager" team it will start (additional security feature) +# If PR is labeled with "Build" and you are a member of "Release manager" team it will start a build train (additional security feature) # on: pull_request: types: [opened, reopened, synchronize, review_requested, labeled] -concurrency: - group: pipeline-pr-${{github.event.pull_request.number}} - cancel-in-progress: true - jobs: Check: permissions: pull-requests: read - name: "verify if compilation can be executed" + name: "Check if 'Build' label is active and user is authorized" if: contains(github.event.pull_request.labels.*.name, 'Build') runs-on: Linux outputs: @@ -36,6 +32,9 @@ jobs: needs: Check name: "Update artifacts" + concurrency: + group: pipeline-pr-${{github.event.pull_request.number}} + cancel-in-progress: true if: ${{ github.repository_owner == 'Armbian' && needs.Check.outputs.member == 'true' }} uses: armbian/os/.github/workflows/complete-artifact-matrix-all.yml@main secrets: