workflows/backport: cancel concurrent runs

When backporting a change to 24.11 and 25.05 at the same time by adding
the two labels immediately *after* merging the PR, three backport jobs
will run concurrently: One for the merge and one for each label added.
Each of those jobs will try to create both PRs, which will lead to two
of the jobs failing for sure.

With a concurrency group and cancelling in-progress jobs, only one of
those jobs will remain. This reduces notification noise.
This commit is contained in:
Wolfgang Walther 2025-06-07 19:36:24 +02:00
parent d859e3fcb9
commit 6276e09530
No known key found for this signature in database
GPG key ID: B39893FA5F65CAE1

View file

@ -9,6 +9,10 @@ on:
pull_request_target:
types: [closed, labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
issues: write