chore: cancel concurrent builds with native feature (#116)

Use the native 'concurrency' configuration feature to cancel
concurrent builds, rather than the cancel-workflow-action.
This also allows us to reduce permissions for the workflow.
This commit is contained in:
Jonathan Yu 2022-01-31 16:13:33 -08:00 committed by GitHub
parent 7cf686c996
commit 515e55db33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 7 deletions

View File

@ -26,6 +26,12 @@ permissions:
security-events: none
statuses: none
# Cancel in-progress runs for pull requests when developers push
# additional changes
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
style-lint-golangci:
name: style/lint/golangci
@ -89,14 +95,7 @@ jobs:
style:
- fmt
fail-fast: false
permissions:
actions: write # for cancel-workflow-action
contents: read
steps:
- name: Cancel previous runs
if: github.event_name == 'pull_request'
uses: styfle/cancel-workflow-action@0.9.1
- name: Checkout
uses: actions/checkout@v2
with: