Last active
February 4, 2024 04:41
-
-
Save adithya2306/7396ae479767708ede9c2ddab84363fa to your computer and use it in GitHub Desktop.
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/python3 | |
from github import Github # requires pip3 install pygithub | |
g = Github(input("Enter token: ")) | |
org = g.get_organization(input("Enter org name: ")) | |
branch = input("Enter branch: ") | |
for repo in org.get_repos(): | |
try: | |
repo.edit(default_branch=branch) | |
print(repo.name, "success") | |
except: | |
print(repo.name, "failed") | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment