Skip to content

Commit 515e55d

Browse files
authored
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.
1 parent 7cf686c commit 515e55d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/coder.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ permissions:
2626
security-events: none
2727
statuses: none
2828

29+
# Cancel in-progress runs for pull requests when developers push
30+
# additional changes
31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.ref }}
33+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
34+
2935
jobs:
3036
style-lint-golangci:
3137
name: style/lint/golangci
@@ -89,14 +95,7 @@ jobs:
8995
style:
9096
- fmt
9197
fail-fast: false
92-
permissions:
93-
actions: write # for cancel-workflow-action
94-
contents: read
9598
steps:
96-
- name: Cancel previous runs
97-
if: github.event_name == 'pull_request'
98-
uses: styfle/cancel-workflow-action@0.9.1
99-
10099
- name: Checkout
101100
uses: actions/checkout@v2
102101
with:

0 commit comments

Comments
 (0)