Created
March 20, 2014 15:09
-
-
Save krusynth/9665929 to your computer and use it in GitHub Desktop.
Get most recent commit for every repo the user has access to.
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
from github import Github | |
from datetime import datetime | |
g = Github("user", "pass") | |
since = datetime(2014, 1, 1) | |
for org in g.get_user().get_orgs(): | |
print org.name | |
for repo in org.get_repos(): | |
commit = '' | |
commits = repo.get_commits(since=since).get_page(0) | |
if commits: | |
commit = commits[0].sha | |
print u'|- {0} ({1})'.format(repo.name, commit) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment