From 0e20c42ccd3f3bf030e400cfa5be7f4822b9a3a2 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 5 Jul 2025 20:26:09 +0800 Subject: [PATCH] docs: update notification docs for Woodpecker 3.x status changes (#65) * docs: update notification docs for Woodpecker 3.x status changes - Add documentation note explaining that in Woodpecker 3.x, build.status is always "success", which affects message templates - Recommend using the when.status condition to separate success and failure notifications, with example YAML provided - Clarify that this issue results from upstream Woodpecker CI changes and is not fixable in the plugin Signed-off-by: appleboy * Update DOCS.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Signed-off-by: appleboy Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- DOCS.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/DOCS.md b/DOCS.md index 457c676..c1b3a8e 100644 --- a/DOCS.md +++ b/DOCS.md @@ -197,3 +197,31 @@ urlencode since : returns a duration string between now and the given timestamp. Example `{{since build.started}}` + +## Note for Woodpecker 3.x Users + +Starting with Woodpecker 3.x, the `build.status` variable is always set to `success`, which means message templates cannot correctly distinguish between success and failure. It is recommended to use the `when.status` condition to split notifications for success and failure, as shown below: + +```yaml +- name: discord success notification + when: + status: [ success ] + image: appleboy/drone-discord + settings: + webhook_id: xxxxxxxxxx + webhook_token: xxxxxxxxxx + message: > + build {{build.number}} succeeded. Good job. + +- name: discord failure notification + when: + status: [ failure ] + image: appleboy/drone-discord + settings: + webhook_id: xxxxxxxxxx + webhook_token: xxxxxxxxxx + message: > + build {{build.number}} failed. Fix me please. +``` + +This is due to a change in Woodpecker CI behavior and cannot be fixed on the plugin side. Please use the above workaround for correct notifications.