fix: refine Telegram links and mailbox selector
Docker Release / Check web and api (push) Waiting to run
Docker Release / Resolve release tag (push) Blocked by required conditions
Docker Release / Build and publish all-in-one (push) Blocked by required conditions
Docker Release / Build and publish api (push) Blocked by required conditions
Docker Release / Build and publish web (push) Blocked by required conditions
Docker Release / Build and publish dovecot (push) Blocked by required conditions
Docker Release / Build and publish postfix (push) Blocked by required conditions
Docker Release / Build and publish rspamd (push) Blocked by required conditions
Docker Release / Create GitHub release (push) Blocked by required conditions

This commit is contained in:
zxyszx
2026-08-06 18:53:21 +08:00
parent 635ab02b29
commit 942605b2b6
6 changed files with 156 additions and 8 deletions
+6 -6
View File
@@ -298,7 +298,9 @@ jobs:
tag = os.environ["RELEASE_TAG"]
prefix = f"<b>NewSzxcn Email {html.escape(tag)}</b>\n新版本现已发布\n\n<b>本次更新</b>\n\n"
available = max(0, 3600 - len(prefix))
release_url = html.escape(os.environ["RELEASE_URL"], quote=True)
footer = f'\n\n🔗 <a href="{release_url}">查看本次更新</a>'
available = max(0, 3600 - len(prefix) - len(footer))
visible_sections = []
used = 0
for section in sections:
@@ -309,20 +311,18 @@ jobs:
used += added
body = "\n\n".join(visible_sections)
if len(visible_sections) < len(sections):
body += "\n\n更新内容较长,请点击下方按钮查看完整内容。"
open("telegram-release-message.txt", "w", encoding="utf-8").write(prefix + body)
body += "\n\n更新内容较长,请打开下方链接查看完整内容。"
open("telegram-release-message.txt", "w", encoding="utf-8").write(prefix + body + footer)
PY
jq -n \
--arg chat_id "${TELEGRAM_CHAT_ID}" \
--arg release_url "${RELEASE_URL}" \
--rawfile text telegram-release-message.txt \
'{
chat_id:$chat_id,
text:$text,
parse_mode:"HTML",
disable_web_page_preview:true,
reply_markup:{inline_keyboard:[[{text:"查看本次更新 ↗",url:$release_url}]]}
disable_web_page_preview:true
}' > telegram-release-payload.json
http_code="$(curl -sS --retry 2 --retry-all-errors --connect-timeout 10 --max-time 30 \