发布通知推送_cf-temp-mail-release-notify
以下为本文档的中文说明
cf-temp-mail-release-notify 是一款专注于项目发布通知的技能,具体用于将 Cloudflare Temp Mail 项目的 GitHub Release 发布到项目的 Telegram 频道话题中。该技能服务于开源项目的发布管理流程,使版本更新能及时准确地触达社区用户。这是一个高度专业化的技能,针对特定项目的 CI/CD 流程中的通知环节。
功能用途上,该技能的核心是自动化发布通知:当用户完成 cf-temp-mail-release 发布流程后,调用该技能将发布笔记推送到 Telegram 频道话题中;帖子内容包括双语(中文 + 英文)的变更日志摘要,以及完整的 Release URL;支持指定版本号或自动使用最新 Release。
使用场景包括:项目维护者在完成版本发布后需要通知社区用户;开源项目通过 Telegram 频道进行社区运营;需要双语发布说明的项目(尤其是中英文双语项目)。
核心特点:第一,精准定位,仅针对 Telegram 频道话题(Message Thread)发布,不污染主频道;第二,双语支持,自动从发布内容中提取中文和英文部分分别展示,照顾不同语言用户;第三,集成度深,与 GitHub CLI(gh)和 uv 包管理器紧密协作;第四,配置化,通过 config.json 管理的 Telegram Token、Chat ID 和话题线程 ID,安全且灵活;第五,内容自动处理,自动剥离 Pull Request 的可折叠内容和缓存清理链接,只保留有价值的变更日志。这使得版本发布通知成为一个自动化、标准化的流程环节。
Release Notify Workflow
Post an existing GitHub release’s notes to the project’s Telegram channel topic.
Prerequisites
config.jsonexists in this skill directory withtoken,chat_id,message_thread_id(gitignored, never commit).ghCLI authenticated.uvinstalled (brew install uv/curl -LsSf https://astral.sh/uv/install.sh | sh). Script uses PEP 723 inline metadata;uvauto-installs deps.
Steps
- Resolve tag: If the user didn’t give one, use the latest release:
gh release list --limit 1 --json tagName --jq '.[0].tagName'. - Run the script:
The script fetches the release viauv run scripts/send_release_to_telegram.py vX.Y.Zgh, splits the body into zh/en sections, strips PR collapsibles and the cache-clearing link, truncates to fit Telegram’s 4096-char limit, and posts to the configuredchat_id+message_thread_id. - Verify: The script prints
ok: message_id=<id>on success. Report the message id.
Notes
- Message uses
parse_mode: MarkdownV2; all content is escaped (viamd_escape) to avoid parse errors on reserved chars_ * [ ] ( ) ~ \\> # + - = | { } . !`. - Only the zh/en changelog sections are posted. PRs list and the cache-clearing discussion link are stripped to keep the message concise.
- For very long release bodies, zh and en are each truncated to ~half of the 3500-char body budget.
