This repository was archived by the owner on Jan 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
39 lines (39 loc) · 1.73 KB
/
kill_all_actions.yaml
File metadata and controls
39 lines (39 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!!WARNING: This kills All actions (all kinds) in the entire repository##
name: 🔫 Kill All Actions 👾
on:
workflow_dispatch:
jobs:
KIA:
runs-on: ubuntu-latest
permissions:
actions: write
statuses: write
steps:
- name: Kill
run: |
##presets
set +x ; set +e
#-------------#
##Stale
kill_all_actions()
{
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
}
export -f kill_all_actions
kill_all_actions ; kill_all_actions ; kill_all_actions
continue-on-error: true