1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Use POST request in github hooks

This commit is contained in:
Steffo 2019-01-02 19:05:01 +01:00
parent dacf8c5696
commit 580ed5bf04

View file

@ -402,13 +402,14 @@ def ses_identify():
return response
@app.route("/hooks/github")
@app.route("/hooks/github", methods=["POST"])
def hooks_github():
try:
j = request.get_json()
except Exception:
abort(400)
return
# TODO: add secret check
message = f"🐙 {j['size']} aggiornamenti a Royalnet ricevuti:\n"
for commit in j.get("commits", []):
message += f"<b>{commit['message']}</b> di {commit['author']}\n"