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