修复 Discord 通知因长消息导致的 400 错误
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
- 添加自定义消息模板,限制消息长度为 200 字符 - 简化通知格式,只保留关键信息 - 避免因过长的 commit message 导致 webhook 请求失败
This commit is contained in:
parent
3efc50deee
commit
399220307b
13
.drone.yml
13
.drone.yml
@ -29,5 +29,18 @@ steps:
|
|||||||
from_secret: discord_webhook_id
|
from_secret: discord_webhook_id
|
||||||
webhook_token:
|
webhook_token:
|
||||||
from_secret: discord_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:
|
when:
|
||||||
status: [success, failure]
|
status: [success, failure]
|
||||||
Loading…
x
Reference in New Issue
Block a user