Created
August 5, 2026 09:45
-
-
Save guibranco/3fc555b1938efdcb94a0b3acd4353eda to your computer and use it in GitHub Desktop.
Delete workflow/actions runs
This file contains hidden or 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
| OWNER=guibranco | |
| REPO=blog | |
| WF=248922293 | |
| gh api --paginate \ | |
| "repos/$OWNER/$REPO/actions/workflows/$WF/runs?status=completed&per_page=100" \ | |
| --jq '.workflow_runs[].id' > run_ids.txt | |
| wc -l run_ids.txt | |
| while read -r id; do | |
| gh run delete "$id" --repo "$OWNER/$REPO" \ | |
| && echo "deleted $id" || echo "skip $id" | |
| sleep 0.3 | |
| done < run_ids.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment