docs: add config example to usage. (#37)

This commit is contained in:
more-pepsi
2023-09-24 12:39:51 +01:00
committed by GitHub
parent 22c00bf3c3
commit 4bb2c902ad
+25
View File
@@ -107,8 +107,33 @@ docker run --rm \
appleboy/drone-discord
```
## Declarative environment config usage
You can get more [information](DOCS.md) about how to use this plugin in drone.
```yml
- name: msg status
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_id
webhook_token:
from_secret: discord_token
message: "{{#success build.status}}✅{{else}}❌{{/success}} Repository `[{{repo.name}}/{{commit.branch}}]` triggered by event `[{{uppercase build.event}}]` for build.\n - Commit [[{{commit.sha}}]({{commit.link}})]\n - Author `[{{commit.author}} / {{commit.email}}]`\n - Message: {{commit.message}} - Drone build [[#{{build.number}}]({{build.link}})] reported `[{{uppercase build.status}}]` at `[{{datetime build.finished \"2006.01.02 15:04\" \"\"}}]`\n"
when:
status: [ success, failure, changed ]
```
```yml
- name: multi line msg status
...
message: >
Line one
Line two
```
## Testing
Test the package with the following command: