From 92438bef1831ba42f41a5457e249e07de1de637f Mon Sep 17 00:00:00 2001 From: Azathothas Date: Fri, 31 Jan 2025 12:02:39 +0545 Subject: [PATCH] saner --- .github/workflows/kill_all_actions.yaml | 37 ++++++++++++++----------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/kill_all_actions.yaml b/.github/workflows/kill_all_actions.yaml index 55c8a7f..30f9c04 100644 --- a/.github/workflows/kill_all_actions.yaml +++ b/.github/workflows/kill_all_actions.yaml @@ -15,20 +15,25 @@ jobs: 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 + 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 \ No newline at end of file