From 515e55db335457b1518644e706f9de6f5d0b1286 Mon Sep 17 00:00:00 2001 From: Jonathan Yu Date: Mon, 31 Jan 2022 16:13:33 -0800 Subject: [PATCH] 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. --- .github/workflows/coder.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index 4fdf90d413..41f1dd04d4 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -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: