Last active
January 8, 2019 11:35
-
-
Save rrajendran/69b2ebf4203491d4b8da2fecb24e572e to your computer and use it in GitHub Desktop.
Python script to make all repos in the github private
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
from github import Github | |
# or using an access token | |
g = Github("<token>") | |
# Then play with your Github objects: | |
for repo in g.get_user().get_repos(): | |
repo_details = g.get_repo(repo.id) | |
if not repo_details.fork: | |
repo_details.edit(private=True) | |
print(str(repo_details.name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment