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.
This commit is contained in:
ColorfulRhino 2024-06-08 12:14:54 +02:00 committed by Igor Pecovnik
parent e72db62f01
commit 3e839e728b
No known key found for this signature in database
GPG Key ID: AC67DF56D680226A

View File

@ -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: