Created
April 4, 2019 11:38
-
-
Save mgramin/1785c0af3d1e297b351be86d29ef5640 to your computer and use it in GitHub Desktop.
Delete all GitHub releases and tags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from requests import Response | |
| from requests.auth import HTTPBasicAuth | |
| releases_url = 'https://api.github.com/repos/sql-boot/sql-boot/releases' | |
| for o in requests.get(releases_url).json(): | |
| print(o['id']) | |
| delete = requests.delete(releases_url + '/' + str(o['id']), auth=HTTPBasicAuth('USER', 'PASSWORD')) | |
| print(releases_url + '/' + str(o['id'])) | |
| print(delete.status_code) | |
| tags_url = 'https://api.github.com/repos/sql-boot/sql-boot/tags' | |
| for o in requests.get(tags_url).json(): | |
| print(o['name']) | |
| delete = requests.delete('https://api.github.com/repos/sql-boot/sql-boot/git/refs/tags/' + str(o['name']), auth=HTTPBasicAuth('USER', 'PASSWORD')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment