Skip to content

Instantly share code, notes, and snippets.

@jonluca
Created February 23, 2019 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonluca/aa827c8812dd47132c2b76cd185352a5 to your computer and use it in GitHub Desktop.
Save jonluca/aa827c8812dd47132c2b76cd185352a5 to your computer and use it in GitHub Desktop.
Watch all of your own repositories
import os
from github import Github
# set an environment variable named GITHUB_KEy to the access token from here https://github.com/settings/tokens
# this script watches all repositories that are under your username
# if you'd like to watch all the repos you've contributed to or that are in your orgs, remove the if check on line 12
g = Github(os.environ['GITHUB_KEY'])
user = g.get_user()
for repo in user.get_repos():
if repo.owner.login == user.login:
print(repo.name)
user.add_to_watched(repo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment