Skip to content

Commit

Permalink
chore: cancel concurrent builds with native feature (#116)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jawnsy committed Feb 1, 2022
1 parent 7cf686c commit 515e55d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 515e55d

Please sign in to comment.