test: Cancel workflow when a PR is updated (#1084)

If another instance of the PR workflow is started for the same PR,
cancel the old one.  If a PR is updated and a new test run is started,
the old test run will be cancelled automatically to conserve
resources.
This commit is contained in:
Joey Parrish 2022-10-21 11:45:55 -07:00 committed by GitHub
parent 9429d26fcb
commit 98e5027fbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -21,6 +21,13 @@ on:
description: "The ref to build and test." description: "The ref to build and test."
required: False required: False
# If another instance of this workflow is started for the same PR, cancel the
# old one. If a PR is updated and a new test run is started, the old test run
# will be cancelled automatically to conserve resources.
concurrency:
group: ${{ github.workflow }}-${{ github.event.inputs.ref || github.ref }}
cancel-in-progress: true
jobs: jobs:
lint: lint:
name: Lint name: Lint