Last active
July 9, 2020 09:14
-
-
Save ShinJJang/97d10bcc81b25fd5c53d17ba580f50c4 to your computer and use it in GitHub Desktop.
Get pull requests with PyGithub, python3 📒
This file contains hidden or 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 python3 | |
from github import Github | |
token = 'YOUR TOKEN' # https://github.com/settings/tokens | |
username = 'YOUR USERNAME' | |
organization = 'YOUR TEAM' | |
gh = Github(token) # or Github(username, password) | |
query = 'org:{} is:merged'.format(organization) # https://help.github.com/en/articles/searching-issues-and-pull-requests | |
issues = list(gh.search_issues(query, author=username, type='pr')) | |
for issue in issues: | |
print(issue.number, issue.state, issue.title, issue.html_url) | |
print('Count : {}'.format(len(issues))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Github enterprise version