From de6d4bf34ede8b4ed6ba2a23b948ac7d253540ad Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Thu, 1 Apr 2021 15:31:58 -0500 Subject: [PATCH] chore(workflows): add ability to cancel all but latest workflow run (#5637) Previously, only workflows older then the current workflow were canceled In very deep queues this means the current instance may not even run until there are future runs enqueued, and those will not run - and thus will not cancel - the current run, leaving the queue in a clogged state Now any time a run instance finally gets off the queue and runs it will check all runs - including runs queued after the current one - and it will clear all non-current runs including itself, hopefully unclogging the queue https://github.com/styfle/cancel-workflow-action/pull/62 --- .github/workflows/cancel.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cancel.yaml b/.github/workflows/cancel.yaml index 13fd233345f4..4320deef0831 100644 --- a/.github/workflows/cancel.yaml +++ b/.github/workflows/cancel.yaml @@ -5,8 +5,10 @@ jobs: name: "Cancel Previous Runs" runs-on: ubuntu-latest timeout-minutes: 3 + # temporarily use cancel-workflow-action fork pending upstream adoption of + # https://github.com/styfle/cancel-workflow-action/pull/62 steps: - - uses: styfle/cancel-workflow-action@0.3.1 + - uses: mikehardy/cancel-workflow-action@0.8.0 with: # Ids in order: # all_plugins @@ -38,4 +40,4 @@ jobs: 2024659, 2057970, 1771737 - access_token: ${{ github.token }} + all_but_latest: true