Skip to content

Instantly share code, notes, and snippets.

@bear
Created January 14, 2016 03:57
Show Gist options
  • Save bear/b4bd32ca79d89c355182 to your computer and use it in GitHub Desktop.
Save bear/b4bd32ca79d89c355182 to your computer and use it in GitHub Desktop.
List all of your pull requests
#!/usr/bin/env python
import os
import json
# pip install PyGithub
from github import Github
github_config = os.path.expanduser('~/.github.cfg')
with open(github_config, 'r') as h:
cfg = json.load(h)
if cfg['auth_token'] is None:
error('Unable to retrieve the auth token from the configuration file %s' % github_config)
else:
gh = Github(cfg['auth_token'])
myid = gh.get_user().id
for issue in gh.search_issues('type:pr is:open'):
if issue.user.id == myid:
print issue.number, issue.title, issue.html_url
@bear
Copy link
Author

bear commented Jan 14, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment