feat(drone): add discord notifications for build status
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Ching L 2025-09-11 17:45:49 +08:00
parent 23c614e78f
commit 3e765f1182

View File

@ -56,15 +56,14 @@ steps:
- export COMMIT_TITLE="$(echo \"${DRONE_COMMIT_MESSAGE}\" | head -n1)"
- echo "COMMIT_TITLE=$COMMIT_TITLE" >> /drone/env
- name: discord notification
- name: discord notification success
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
color: >
$(if [ "${DRONE_BUILD_STATUS}" = "success" ]; then echo "#48f442"; else echo "#ff4f42"; fi)
color: "#48f442"
message:
- |
${DRONE_REPO}
@ -72,7 +71,25 @@ steps:
Branch: ${DRONE_COMMIT_BRANCH}
Link: ${DRONE_BUILD_LINK}
when:
status: [success, failure]
status: [success]
- name: discord notification failure
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
color: "#ff4f42"
message:
- |
${DRONE_REPO}
Commit: ${COMMIT_TITLE}
Branch: ${DRONE_COMMIT_BRANCH}
Link: ${DRONE_BUILD_LINK}
when:
status: [failure]
volumes: