- GitHub CLI
Created
July 28, 2022 06:07
-
-
Save ronek22/29940b4db1821509ec730e46b60b97e5 to your computer and use it in GitHub Desktop.
Delete workflow 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
| #!/bin/bash | |
| ORG="gigb-official" | |
| REPO="django-gigb" | |
| WORKFLOW="lint.yml" | |
| gh config set pager cat | |
| WORKFLOW_RUNS=$(gh api -H "Accept: application/vnd.github.v3+json" "/repos/$ORG/$REPO/actions/workflows/$WORKFLOW/runs?per_page=100" | jq '.workflow_runs[] | .id') | |
| WORKFLOW_RUNS=($WORKFLOW_RUNS) | |
| for s in "${WORKFLOW_RUNS[@]}"; do | |
| gh api --method DELETE -H "Accept: application/vnd.github.v3+json" /repos/$ORG/$REPO/actions/runs/$s | |
| done | |
| gh config set pager less |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment