Skip to content

Instantly share code, notes, and snippets.

@joejordanbrown
Last active April 27, 2025 14:50
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.

Revisions

  1. joejordanbrown created this gist Dec 20, 2020.
    10 changes: 10 additions & 0 deletions gh-cleanup-releases-tags.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #! /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