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 <appleboy.tw@gmail.com>
This commit is contained in:
appleboy
2025-07-05 20:22:59 +08:00
parent 9f96bb575e
commit 30fbdbe54d
+28
View File
@@ -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 from 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.