Created
March 24, 2021 16:45
-
-
Save peavers/327c5bb985ef81ae718884299ee01bc0 to your computer and use it in GitHub Desktop.
Bulk delete workflows from GitHub Actions
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
# Requires GitHub CLI installed and authenticated. | |
export USER="" | |
export REPO="" | |
export BRANCH="master" | |
gh api repos/$USER/$REPO/actions/runs | jq -r '.workflow_runs[] | select(.head_branch == "master") | "\(.id)"' | xargs -n1 -I % gh api repos/$USER/$REPO/actions/runs/% -X DELETE > out.log 2> /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment