This commit is contained in:
2025-04-13 14:37:17 +08:00
parent 4df85be884
commit c92b26e436

View File

@@ -49,6 +49,9 @@ steps:
- name: notify - name: notify
image: 10.7.127.190:38080/plugins/webhook:latest image: 10.7.127.190:38080/plugins/webhook:latest
environment:
WEBHOOK_URL:
from_secret: wechat_webhook_url
when: when:
status: [ success,failure ] status: [ success,failure ]
settings: settings:
@@ -56,16 +59,18 @@ steps:
content_type: application/json content_type: application/json
template: | template: |
{ {
"msgtype": "news", "msgtype": "markdown",
"news": { "markdown": {
"articles": [ "content": "{{#success build.status}}<font color=\"green\">✅ 构建成功</font>{{else}}<font color=\"red\">❌ 构建失败</font>{{/success}}\n\n
{ **📦 项目**: {{repo.owner}}/{{repo.name}} \n
"title": "{{repo.owner}}/{{repo.name}} 构建通知 ({{build.status}})", **🔢 构建号**: #{{build.number}} \n
"description": "{{#success build.status}}成功{{else}}失败{{/success}} | 分支: {{build.branch}} | 提交: {{build.commit}}", **🌿 分支**: <font color=\"comment\">{{build.branch}}</font> \n
"url": "{{build.link}}", **🆔 提交标识**: `{{build.commit}}` \n
"picurl": "${DRONE_COMMIT_AUTHOR_AVATAR}" **👤 提交者**: {{build.author}} \n
} **📝 提交信息**: {{build.message}} \n
] **⏱️ 持续时间**: {{build.duration}}秒 \n\n
{{^success build.status}}**📜 失败日志**: [点击查看]({{build.link}}/logs) \n{{/success}}
[📊 查看详情]({{build.link}})"
} }
} }