show new and merged PRs

This commit is contained in:
Lephenixnoir 2021-03-14 09:48:15 +01:00
parent b0482c36a5
commit ce478b06ef
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 13 additions and 0 deletions

13
app.py
View File

@ -77,6 +77,19 @@ def main():
if data['action'] == "created":
msg = f"{url_user} a répondu au ticket {url_issue} dans {url_repository}"
if event == "pull_request" and data["action"] == "opened":
url_user = make_url_user(data["sender"])
url_pr = f"[url={data['pull_request']['url']}]{data['pull_request']['title']}[/url]"
msg = f"{url_user} a créé une PR: {url_pr} dans {url_repository}"
if event == "pull_request" and data["action"] == "closed":
action = "fusionné" if data["pull_request"]["merged"] else "fermé"
url_user = make_url_user(data["sender"])
url_pr = f"[url={data['pull_request']['url']}]{data['pull_request']['title']}[/url]"
msg = f"{url_user} a {action} la PR {url_pr} dans {url_repository}"
if event == "pull_request" and data["action"] == "assigned":
return "IGN"