From 19952e6d0376abb1bffc1f070e115f99b6bad076 Mon Sep 17 00:00:00 2001 From: ThePedroo Date: Thu, 20 Jun 2024 19:55:56 -0300 Subject: [PATCH] remove: telegram script for releases This commit removes the telegram script that sends a message in a telegram repository every release. --- .github/scripts/telegram_url.py | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/scripts/telegram_url.py diff --git a/.github/scripts/telegram_url.py b/.github/scripts/telegram_url.py deleted file mode 100644 index e869690..0000000 --- a/.github/scripts/telegram_url.py +++ /dev/null @@ -1,25 +0,0 @@ -import json -import os -import urllib.parse - -url = f'https://api.telegram.org/bot{os.environ["BOT_TOKEN"]}' -url += f'/sendMediaGroup?chat_id={urllib.parse.quote(os.environ["CHANNEL_ID"])}&media=' - -# https://core.telegram.org/bots/api#markdownv2-style -msg = os.environ["COMMIT_MESSAGE"] -for c in ['\\', '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!']: - msg = msg.replace(c, f'\\{c}') -commit_url = os.environ["COMMIT_URL"] -commit_id = os.environ["COMMIT_ID"][:7] - -caption = f"[{commit_id}]({commit_url})\n{msg}"[:1024] - -data = json.dumps([ - {"type": "document", "media": "attach://Release"}, - {"type": "document", "media":"attach://Debug"}, - {"type": "document", "media": "attach://ReleaseSymbol"}, - {"type": "document", "media": "attach://DebugSymbol","caption": caption,"parse_mode":"MarkdownV2"} - ]) - -url += urllib.parse.quote(data) -print(url) \ No newline at end of file