修复 Discord 通知因长消息导致的 400 错误
All checks were successful
continuous-integration/drone/push Build is passing

- 添加自定义消息模板,限制消息长度为 200 字符
- 简化通知格式,只保留关键信息
- 避免因过长的 commit message 导致 webhook 请求失败
This commit is contained in:
Ching L 2025-09-08 11:28:36 +08:00
parent 3efc50deee
commit 399220307b

View File

@ -29,5 +29,18 @@ steps:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: Drone CI
avatar_url: https://github.com/drone.png
message: |
{{#success build.status}}
✅ **Build #{{build.number}}** succeeded
{{else}}
❌ **Build #{{build.number}}** failed
{{/success}}
**Repo:** {{repo.name}}
**Branch:** {{build.branch}}
**Commit:** `{{truncate build.commit 8}}`
**Author:** {{build.author}}
**Message:** {{truncate build.message 200}}
when:
status: [success, failure]