-
-
Save ansiwen/fcb9e630bcf636309298e2167775aee8 to your computer and use it in GitHub Desktop.
Automatically star any OpenStack Git repository which contains own commits
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 python | |
from github import Github | |
from getpass import getpass | |
USERNAME = raw_input("GitHub username: ") | |
PASSWORD = getpass() | |
ORGS = ("openstack", "stackforge", "openstack-dev", "openstack-infra") | |
g = Github(USERNAME, PASSWORD) | |
me = g.get_user() | |
for org in ORGS: | |
user = g.get_user(org) | |
for repo in user.get_repos(): | |
commits = repo.get_commits(author=me) | |
if any(commits): | |
print("Starring %s" % repo.full_name) | |
me.add_to_starred(repo) | |
else: | |
print("Ignoring %s" % repo.full_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment