workflows: add concurrency group to check-by-name workflow

On event that triggers the workflow for the matching concurrency group, any
previous runs of the workflow in the same group will be cancelled.
This commit is contained in:
Will Bush 2024-04-22 13:01:42 -05:00
parent 80368c5bef
commit 75600cde6b
No known key found for this signature in database
GPG key ID: 3823864B54B13BDA

View file

@ -16,6 +16,13 @@ on:
# so it shouldn't be a problem
types: [opened, synchronize, reopened, edited]
# Create a check-by-name concurrency group based on the branch name. if a new
# commit is pushed to the main branch while a previous run is still in progress,
# the previous run will be cancelled and the new one will start.
concurrency:
group: check-by-name-${{ github.ref }}
cancel-in-progress: true
permissions:
# We need this permission to cancel the workflow run if there's a merge conflict
actions: write