Created
February 3, 2018 00:54
-
-
Save juliusknorr/de6e2082e67cb3cb5906fc0fe25a1368 to your computer and use it in GitHub Desktop.
github-merge-report for sending list of updated pull requests of the last day
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, timedelta | |
date = datetime.today() - timedelta(days=1) | |
g = Github("username", "apikey") | |
query = "org:nextcloud type:pr is:merged base:master updated:>=%s" % date.strftime("%Y-%m-%d") | |
prs = g.search_issues(query, sort="updated", order="desc") | |
mapping = {} | |
for pr in prs: | |
if pr.repository.name not in mapping: | |
mapping[pr.repository.name] = [] | |
mapping[pr.repository.name].append(pr) | |
for repo in mapping: | |
print("[%s]" % repo) | |
for pr in mapping[repo]: | |
prdate = pr.updated_at | |
print(" - %s (%s)" % (pr.title, pr.html_url)) | |
print("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment