🔫 Kill All Actions 👾 #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!!WARNING: This kills All actions (all kinds) in the entire repository## | |
name: 🔫 Kill All Actions 👾 | |
on: | |
workflow_dispatch: | |
jobs: | |
linkChecker: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
statuses: write | |
steps: | |
- name: Kill | |
run: | | |
##presets | |
set +x ; set +e | |
#-------------# | |
##Stale | |
gh run list --repo "${GITHUB_REPOSITORY}" --json databaseId --jq '.[].databaseId' --limit '1000' --status 'stale' |\ | |
xargs -I "{}" gh run cancel "{}" --repo "${GITHUB_REPOSITORY}" & | |
##Queued | |
gh run list --repo "${GITHUB_REPOSITORY}" --json databaseId --jq '.[].databaseId' --limit '1000' --status 'queued' |\ | |
xargs -I "{}" gh run cancel "{}" --repo "${GITHUB_REPOSITORY}" & | |
##Requested | |
gh run list --repo "${GITHUB_REPOSITORY}" --json databaseId --jq '.[].databaseId' --limit '1000' --status 'requested' |\ | |
xargs -I "{}" gh run cancel "{}" --repo "${GITHUB_REPOSITORY}" & | |
##Waiting | |
gh run list --repo "${GITHUB_REPOSITORY}" --json databaseId --jq '.[].databaseId' --limit '1000' --status 'waiting' |\ | |
xargs -I "{}" gh run cancel "{}" --repo "${GITHUB_REPOSITORY}" & | |
##In_Progress (Must be last) | |
gh run list --repo "${GITHUB_REPOSITORY}" --json databaseId --jq '.[].databaseId' --limit '1000' --status 'in_progress' |\ | |
xargs -I "{}" gh run cancel "{}" --repo "${GITHUB_REPOSITORY}" & | |
##Wait | |
wait ; echo | |
continue-on-error: true |