Created
October 7, 2019 19:48
-
-
Save fmartingr/0a15681dd204ec7bd1774364a40e8338 to your computer and use it in GitHub Desktop.
Remove all forked repositories on the user account that is nor archived
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
# pip install github3 | |
import github3 | |
USERNAME = "" | |
TOKEN = "" | |
gh = github3.login(username=USERNAME, token=TOKEN) | |
for repository in gh.repositories(): | |
if repository.owner.login == USERNAME and repository.fork and not repository.archived: | |
print(f"Removing {'/'.join(repository.url.split('/')[-2:])}") | |
repository.delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment