Created
May 19, 2022 14:31
-
-
Save andyhite/0d1a378a880686765e5548b62e80a425 to your computer and use it in GitHub Desktop.
Delete all runs of a specific GitHub Workflow with one command
This file contains 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
export GH_PAGER=cat # this is important to keep gh from using less as a pager | |
export GH_REPO="<org-name>/<repo-name>" # for instance, shipengine/shipengine-elements | |
export GH_WORKFLOW_FILENAME="<workflow-filename>" # for instance, "lint-and-test.yml" | |
gh api repos/$GH_REPO/actions/workflows/$GH_WORKFLOW_FILENAME/runs --paginate --jq '.workflow_runs[] | .id' | \ | |
xargs -n 1 -I % gh api repos/$GH_REPO/actions/runs/% -X DELETE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment