You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
Upload CI builds to telegram
This commit is contained in:
22
.github/scripts/telegram_url.py
vendored
Normal file
22
.github/scripts/telegram_url.py
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
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='
|
||||
|
||||
msg = os.environ["COMMIT_MESSAGE"]
|
||||
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)
|
||||
Reference in New Issue
Block a user