1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Don't crash if a non-master and non-unity branch is pushed to

This commit is contained in:
Steffo 2019-03-24 12:00:50 +01:00
parent 36fb339480
commit 0b7219f27a

View file

@ -394,8 +394,11 @@ def hooks_github():
# TODO: add secret check # TODO: add secret check
if j["ref"] == "refs/heads/master": if j["ref"] == "refs/heads/master":
message = f"🐙 Nuovi aggiornamenti a Royalnet <code>master</code>:\n" message = f"🐙 Nuovi aggiornamenti a Royalnet <code>master</code>:\n"
if j["ref"] == "refs/heads/unity": elif j["ref"] == "refs/heads/unity":
message = f"🐙 Progresso di Royalnet <code>unity</code>:\n" message = f"🐙 Progresso di Royalnet <code>unity</code>:\n"
else:
return "Ignored."
if message:
for commit in j.get("commits", []): for commit in j.get("commits", []):
if commit["distinct"]: if commit["distinct"]:
message += f'<a href="{commit["url"]}">{commit["message"]}</a>' \ message += f'<a href="{commit["url"]}">{commit["message"]}</a>' \