Last active
May 24, 2018 14:35
-
-
Save gastaldi/2d47ca122ad4a18c4b2deaf262f8feba to your computer and use it in GitHub Desktop.
Delete all github repositories
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
#!/usr/bin/env bash | |
#your github token | |
TOKEN=xxxx | |
echo The following repositories will be deleted: | |
http https://api.github.com/user/repos "Authorization:token $TOKEN" per_page==100 type==owner | jq '.[].full_name' | |
read -p "Continue (y/n)?" CONT | |
if [ "$CONT" = "y" ]; then | |
echo Deleting repositories | |
http https://api.github.com/user/repos "Authorization:token $TOKEN" per_page==100 type==owner | jq '.[].full_name' | xargs -I '{}' http DELETE https://api.github.com/repos/'{}' "Authorization:token $TOKEN" | |
else | |
echo Nothing was done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment