Created
December 18, 2019 14:57
-
-
Save jorgerance/45f05b065c53b960627f90332cd7b09e to your computer and use it in GitHub Desktop.
github_delete-list.sh
This file contains 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
#!/bin/bash | |
TOKEN=<YOUR_GITHUB_OAUTH_TOKEN> | |
# Remember to enable de "delete_repo" OAuth scope on the token you just defined | |
# Delete a set o repositories defined on a plain text file | |
# i.e.: | |
# user@host ~/ $ cat repositories_to_delete.txt | |
# username/reponame1 | |
# username/reponame2 | |
# username/reponame3 | |
# username/reponame4 | |
# username/reponame5 | |
# username/reponame6 | |
# username/reponame7 | |
# username/reponame8 | |
# user@host ~/ $ | |
cat repositories_to_delete.txt | while read r; do | |
echo " -> Deleting $r" | |
curl -X DELETE -H "Authorization: token $TOKEN" https://api.github.com/repos/$r done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment