From 399220307b9d8e46f2599056077e11ef8d460873 Mon Sep 17 00:00:00 2001 From: Ching L Date: Mon, 8 Sep 2025 11:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Discord=20=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=9B=A0=E9=95=BF=E6=B6=88=E6=81=AF=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=20400=20=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加自定义消息模板,限制消息长度为 200 字符 - 简化通知格式,只保留关键信息 - 避免因过长的 commit message 导致 webhook 请求失败 --- .drone.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.drone.yml b/.drone.yml index f4d71e1..d0b3694 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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] \ No newline at end of file