Skip to content

Instantly share code, notes, and snippets.

@joejordanbrown
Last active November 9, 2024 17:05
Show Gist options
  • Save joejordanbrown/6f25e3ff5f206b5a99d4f511bcd5b8f9 to your computer and use it in GitHub Desktop.
Save joejordanbrown/6f25e3ff5f206b5a99d4f511bcd5b8f9 to your computer and use it in GitHub Desktop.
GitHub Cli - Delete all releases and tags in repo.
#! /bin/sh
for num in `gh release list 2>/dev/null | awk '{print $1}'`; do
gh release delete $num -y
done
for num in `gh api repos/:owner/:repo/tags | jq -r '.[].name'`; do
gh api repos/:owner/:repo/git/refs/tags/${num} -X DELETE
echo '✓ Deleted tag' $num
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment