diff --git a/webserver.py b/webserver.py
index 89c440b7..ba82eba7 100644
--- a/webserver.py
+++ b/webserver.py
@@ -394,15 +394,18 @@ def hooks_github():
# TODO: add secret check
if j["ref"] == "refs/heads/master":
message = f"🐙 Nuovi aggiornamenti a Royalnet master
:\n"
- if j["ref"] == "refs/heads/unity":
+ elif j["ref"] == "refs/heads/unity":
message = f"🐙 Progresso di Royalnet unity
:\n"
- for commit in j.get("commits", []):
- if commit["distinct"]:
- message += f'{commit["message"]}' \
- f' di {commit["author"].get("username", "anonimo")}\n'
- telegram_bot.send_message(config["Telegram"]["main_group"], message,
- parse_mode="HTML", disable_web_page_preview=True, disable_notification=True)
- return "Done."
+ else:
+ return "Ignored."
+ if message:
+ for commit in j.get("commits", []):
+ if commit["distinct"]:
+ message += f'{commit["message"]}' \
+ f' di {commit["author"].get("username", "anonimo")}\n'
+ telegram_bot.send_message(config["Telegram"]["main_group"], message,
+ parse_mode="HTML", disable_web_page_preview=True, disable_notification=True)
+ return "Done."
@app.before_request