Skip to content

Commit

Permalink
chore(workflows): add ability to cancel all but latest workflow run (#…
Browse files Browse the repository at this point in the history
…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

styfle/cancel-workflow-action#62
  • Loading branch information
mikehardy committed Apr 1, 2021
1 parent 8a719fe commit de6d4bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/cancel.yaml
Expand Up @@ -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
Expand Down Expand Up @@ -38,4 +40,4 @@ jobs:
2024659,
2057970,
1771737
access_token: ${{ github.token }}
all_but_latest: true

0 comments on commit de6d4bf

Please sign in to comment.