From c0a8443afa4e7f5c8c8afc7cd6c581bf5840ff3c Mon Sep 17 00:00:00 2001 From: Steve Gilham Date: Tue, 4 Jul 2023 08:46:49 +0100 Subject: [PATCH] Workflow cancellation as per # per https://www.meziantou.net/how-to-cancel-github-workflows-when-pushing-new-commits-on-a-branch.htm --- .github/workflows/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e17eee52..66894e06 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,17 @@ on: branches: - master +# per https://www.meziantou.net/how-to-cancel-github-workflows-when-pushing-new-commits-on-a-branch.htm +# https://docs.github.com/en/actions/learn-github-actions/expressions +# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context +concurrency: + # github.workflow: name of the workflow + # github.event.pull_request.number || github.ref: pull request number or branch name if not a pull request + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + + # Cancel in-progress runs when a new workflow with the same group name is triggered + cancel-in-progress: true + jobs: windows: runs-on: windows-latest