Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "cancel run" for all scheduled github actions at once?

Is there an option to cancel runs for all scheduled github actions in one repository at once. To always go here and cancel runs is a lot of clicking. enter image description here

like image 502
Tobi Avatar asked Dec 28 '25 15:12

Tobi


1 Answers

macOS oneliner (inspired by other answers):

for id in $(gh run list --limit 5000 --jq ".[] | select (.status == \"queued\" ) | .databaseId" --json databaseId,status); do gh run cancel $id; done

# List 5000 runs, filters them by "status == queued", and passes them to "gh run cancel"

Notes:

  1. Install gh cli first by brew install gh and gh auth login
  2. You need to run this in your local repository.
like image 62
ThomasEdwin Avatar answered Dec 31 '25 19:12

ThomasEdwin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!