Last active
August 26, 2021 17:51
-
-
Save wzulfikar/e9064862d17467ed36b81d2f2c17389a to your computer and use it in GitHub Desktop.
Drone CI slack template. more on drone.io + slack integration: http://plugins.drone.io/drone-plugins/drone-slack/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline: | |
build: | |
image: alpine | |
commands: | |
- echo "do something :v" | |
slack: | |
image: plugins/slack | |
channel: dev__builds | |
webhook: https://hooks.slack.com/services/... | |
# here's the template :) | |
# notice that the repo endpoint is hardcoded to `https://github.com/`. | |
# you may adjust it accordingly. | |
template: > | |
{{#if build.pull }} | |
*{{#success build.status}}✔{{ else }}✘{{/success}} {{ uppercasefirst build.status }}*: <https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ build.pull }}|Pull Request #{{ build.pull }}> | |
{{else}} | |
*{{#success build.status}}✔{{ else }}✘{{/success}} {{ uppercasefirst build.status }}: Build #{{ build.number }}* (type: `{{ build.event }}`) | |
{{/if}} | |
Commit: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commit/{{ build.commit }}|{{ truncate build.commit 8 }}> | |
Branch: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}> | |
Author: {{ build.author }} | |
<{{ build.link }}|Visit build page ↗> |
Thanks for this! Got me started with drone and slack integration
With pleasure!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And here's how the template will look like in slack: