Created
September 2, 2020 15:22
-
-
Save bradymholt/17b3549f212f4b2d656a4f385293b6a5 to your computer and use it in GitHub Desktop.
Delete GitHub draft releases
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
TOKEN=123; curl -Ss -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \ | |
"https://api.github.com/repos/username/repo_name/releases?per_page=100&page=1" \ | |
| jq -r '.[] | select(.draft == true) | .id' \ | |
| xargs -I {} -L 1 \ | |
curl -L -H "Authorization: token $TOKEN" -X DELETE "https://api.github.com/repos/username/repo_name/releases/{}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment