I tried the github cli:
gh release list | sed 's/|/ /' | awk '{print $1, $8}' | while read -r line; do gh release delete -y "$line"; done
as described here: https://dev.to/dakdevs/delete-all-releases-from-github-repo-13ad
But it only works for releases where the name equals the tag. As soon as a name has spaces in it, awk fails to separate the columns properly.
maybe the gh cli output changed since the article was written or awk on macos has different defaults?
Adding
-F '\t'helpedawkto separate the columns correctly. This command deletes all gh releases:You can also delete the tags with the following flag: