mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-30 15:04:18 +00:00
Use POST request in github hooks
This commit is contained in:
parent
dacf8c5696
commit
580ed5bf04
1 changed files with 2 additions and 1 deletions
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue