mirror of https://github.com/coder/coder.git
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:
parent
7cf686c996
commit
515e55db33
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue