Skip to content

ci: translate release notes for DingTalk notifications#286

Merged
eetoc merged 1 commit into
mainfrom
ci/notify-dingtalk-release
Jul 14, 2026
Merged

ci: translate release notes for DingTalk notifications#286
eetoc merged 1 commit into
mainfrom
ci/notify-dingtalk-release

Conversation

@eetoc

@eetoc eetoc commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Notify DingTalk after a GitHub Release is published.
  • Translate every release-note entry into Simplified Chinese with an OpenAI-compatible Chat Completions API.
  • Keep the GitHub Release body unchanged and place the translated changes before the Release link in DingTalk.
  • Support workflow_dispatch with an existing release tag for testing.
  • Sign DingTalk requests with DINGTALK_SECRET.

Required GitHub Actions secrets

  • DINGTALK_WEBHOOK
  • DINGTALK_SECRET
  • RELEASE_LLM_API_URL
  • RELEASE_LLM_API_KEY
  • RELEASE_LLM_MODEL

Validation

  • Local end-to-end test with v2607.6.6 translated the release notes and sent a DingTalk message successfully.
  • Workflow YAML and embedded Bash syntax checks passed.

Notes

  • The LLM endpoint must accept an OpenAI-compatible Chat Completions request and return choices[0].message.content.
  • GitHub Release creation remains unchanged and continues to use the original release notes.

@monkeyscan

monkeyscan Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Title: ci: translate release notes for DingTalk notificat...

Commit: e2a0795

本次 PR 新增了一个 GitHub Actions 工作流,用于在 release 发布时通过 LLM 翻译 release notes 并发送至钉钉。整体实现较为完整,包含 secrets 校验、手动/自动触发支持、临时文件清理等健壮性措施。但审查发现两个关键缺陷:1)钉钉 Webhook 签名字符串因多行 bash 字符串包含多余缩进空格,导致签名校验必然失败,属于高严重性功能缺陷;2)通知内容中硬编码产品名 agent-compose,降低了工作流的可复用性。建议修复后重新提交。

Comment thread .github/workflows/notify-dingtalk-release.yml
Comment thread .github/workflows/notify-dingtalk-release.yml
@monkeyscan

monkeyscan Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Title: ci: translate release notes for DingTalk notificat...

Commit: c4ba284

此 PR 将 DingTalk 发布通知工作流的触发方式从 release 事件的 published 改为监听 Images & Release 工作流的 workflow_run 完成,并重构了脚本逻辑以统一从 GitHub API 获取 release 信息。

关键变更点:

  1. 触发条件改为 workflow_run(监听 Images & Release 工作流完成)+ workflow_dispatch 手动触发。
  2. 新增 job 级别条件,仅当 workflow_run 成功、事件为 push、且 head_branchv 开头时才执行。
  3. 环境变量从 EVENT_RELEASE_* 改为 WORKFLOW_RUN_TAG(取自 github.event.workflow_run.head_branch)。
  4. 脚本逻辑统一:无论自动触发还是手动触发,都通过 gh api 从 GitHub API 获取 release 信息。

整体评估:该变更逻辑合理,通过监听上游工作流完成来确保通知时机。head_branch 在 tag push 时对应 tag 名,与 GitHub 文档一致。条件过滤减少了误触发。未发现由本次变更引入的功能性 bug 或安全问题。

@eetoc
eetoc force-pushed the ci/notify-dingtalk-release branch from c4ba284 to 1f1480a Compare July 14, 2026 09:33
@monkeyscan

monkeyscan Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Title: ci: translate release notes for DingTalk notificat...

Commit: 1f1480a

本次 PR 新增了一个 GitHub Actions 工作流 .github/workflows/notify-dingtalk-release.yml,用于在 "Images & Release" 工作流成功完成后,自动获取 Release 信息,通过外部 LLM 将英文发布说明翻译成简体中文,最后调用钉钉机器人 Webhook 发送通知。工作流支持 workflow_run 自动触发和 workflow_dispatch 手动触发两种方式,并对所有必需的环境变量进行了前置校验。脚本中使用了 set -euo pipefail 和临时文件安全清理,整体结构清晰。

但存在以下已知问题:

  1. string_to_sign 使用 bash 多行双引号字符串拼接 timestampDINGTALK_SECRET,第二行的 YAML 缩进空格会被原样保留到字符串中,导致 DingTalk 签名校验失败。
  2. 通知标题和正文中硬编码了产品名 agent-compose,降低了工作流的可复用性。

@eetoc
eetoc marked this pull request as ready for review July 14, 2026 09:38
@eetoc
eetoc merged commit 884ad3f into main Jul 14, 2026
10 checks passed
@eetoc
eetoc deleted the ci/notify-dingtalk-release branch July 14, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant