Last active
November 14, 2024 22:56
-
-
Save tangrufus/dc4c802c859596d88961411f67176573 to your computer and use it in GitHub Desktop.
Delete all GitHub workflow run history
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 | |
set -euExo pipefail | |
THE_ORG=foo | |
THE_REPO=bar | |
gh api -X GET /repos/${THE_ORG}/${THE_REPO}/actions/runs --paginate \ | |
| jq '.workflow_runs[] | .id' \ | |
| xargs -t -I{} gh api -X DELETE /repos/${THE_ORG}/${THE_REPO}/actions/runs/{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment