Skip to content

Instantly share code, notes, and snippets.

@tangrufus
Last active November 14, 2024 22:56
Show Gist options
  • Save tangrufus/dc4c802c859596d88961411f67176573 to your computer and use it in GitHub Desktop.
Save tangrufus/dc4c802c859596d88961411f67176573 to your computer and use it in GitHub Desktop.
Delete all GitHub workflow run history
#!/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