I also had to do this. Anton Sizikovโs answer is right, but working with github api directly can sometimes be a little complicated.
hub had a problem with this , and PR is now merged ๐
To remove the release, all you have to do is install hub and run it inside the project folder:
hub release delete <TAG>
You can remove all issues with something like this
git fetch --all --tags git tag | xargs hub release delete
Or you can list all the tags that you want to remove in the file (one tag per line), then follow these steps:
cat tags_i_want_to_delete.txt | xargs hub release delete
See TL; DR xargs more details.
Alternative solution: working nodejs example for removing draft tags
Thanks to Steve Mao for github-remove-all-releases !
npm init npm install --save github-remove-all-releases dotenv
main.js :
require('dotenv').config(); var githubRemoveAllReleases = require('github-remove-all-releases'); var AUTH = { type: 'oauth', token: process.env.GITHUB_TOKEN };
Get yourself a token and create the .env file as follows:
GITHUB_OWNER=owner GITHUB_REPO=repo GITHUB_TOKEN=your_token
Then run this (several times, since it does not support pagination):
npm main.js
source share