1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-08 08:19:59 +02:00
zen-desktop/scripts/remove-failed-jobs.sh
Cristian Cezar Moisés 2217959242
Update remove-failed-jobs.sh
Signed-off-by: Cristian Cezar Moisés <ethicalhacker@riseup.net>
2025-01-03 23:01:16 +00:00

25 lines
707 B
Bash

gh_bulk_delete_workflow_runs() {
repo=$1
# Ensure the repo argument is provided
if [[ -z "$repo" ]]; then
echo "Usage: gh_bulk_delete_workflow_runs <owner/repo>"
return 1
fi
runs=$(gh api repos/$repo/actions/runs --paginate |
jq -r '.workflow_runs[] |
select(.conclusion == "cancelled" or
.conclusion == "failure" or
.conclusion == "timed_out") |
.id')
while IFS= read -r run; do
echo "Deleting run https://github.com/$repo/actions/runs/$run"
gh api -X DELETE repos/$repo/actions/runs/$run --silent
done <<< "$runs"
echo "All workflow runs for $repo have been deleted."
}
gh_bulk_delete_workflow_runs "$1"