Skip to content

Instantly share code, notes, and snippets.

@bradymholt
Created September 2, 2020 15:22
Show Gist options
  • Save bradymholt/17b3549f212f4b2d656a4f385293b6a5 to your computer and use it in GitHub Desktop.
Save bradymholt/17b3549f212f4b2d656a4f385293b6a5 to your computer and use it in GitHub Desktop.
Delete GitHub draft releases
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