forked from bitrise-steplib/steps-slack-message
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep.yml
322 lines (284 loc) · 12.2 KB
/
step.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
title: Send a Quill message
summary: Send a [Quill](https://quill.chat/) message to a channel.
description: |-
Post a [Quill](https://quill.chat/) message using a Webhook.
Create and customize the messages however you see fit.
Among other things, you can:
- Set a different text for failed and successful builds.
- Add an icon and/or emojis to your messages.
- Set the bot user's name for the messages.
- Linkify channel names and usernames.
- Add and customize attachments.
### Configuring the Step
To use this Step, you need [a Quill incoming webhook](https://docs.quill.chat/docs/specification).
The webhook is created for a specific channel, so the channel cannot be changed through configuration in this Step.
Once you're ready with that, come back to Bitrise and configure the Step itself.
1. Create a [Secret Env Var](https://devcenter.bitrise.io/builds/env-vars-secret-env-vars/) for either your Quill webhook URL.
1. Add the Secret to **Quill Webhook URL**.
1. Toggle the **Run if previous Step failed** option on - you should see a white checkmark on green background next to it. This allows Quill messages to be sent for failed builds, too.
1. Customize your messages as you'd like. For the details, see the respective inputs.
### Troubleshooting
Don't forget to make sure that the Step runs even if the build fails: you need to set it so that it runs even if a previous Step failed.
If the Step fails, check your Quill settings and the incoming webhook.
### Useful links
- [Quill incoming webhooks](https://docs.quill.chat/docs/specification)
- [Slack attachments](https://api.slack.com/messaging/composing/layouts#attachments)
### Related Steps
- [Slack message](https://www.bitrise.io/integrations/steps/slack)
- [Send email with Mailgun](https://www.bitrise.io/integrations/steps/email-with-mailgun)
- [Post Jira Comment](https://www.bitrise.io/integrations/steps/post-jira-comment-with-build-details)
website: https://github.com/HarperDog/steps-quill-message
source_code_url: https://github.com/HarperDog/steps-quill-message
support_url: https://github.com/HarperDog/steps-quill-message/issues
type_tags:
- notification
is_requires_admin_user: false
is_always_run: true
is_skippable: true
toolkit:
go:
package_name: github.com/HarperDog/steps-quill-message
inputs:
- is_debug_mode: "no"
opts:
title: "Debug mode?"
description: |
Step prints additional debug information if this option
is enabled
value_options:
- "yes"
- "no"
# Message inputs
- webhook_url:
opts:
title: "Quill Webhook URL"
description: |
You can create an incoming channel webhook for a channel by going to Settings,
selecting the Team that owns the channel,
clicking the Incoming Webhooks tab then clicking Add Webhook.
is_required: true
is_sensitive: true
- text:
opts:
title: "Text of the message."
description: |
Text of the message to send.
Required unless you wish to send attachments only.
- text_on_error:
opts:
title: "Text of the message if the build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
- thread_title:
opts:
title: "Title of the message thread"
description: |
Set the title of a new thread, or update the title of an existing thread.
- thread_title_on_error:
opts:
title: "Title of the message thread if the build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
- thread_uid:
opts:
title: "Thread UID"
description: |
Unique ID of the thread to create or reuse when posting this message.
The first time a specific value is given, a new thread will be created.
Subsequent requests with the same value will post messages to the same thread.
- thread_uid_on_error:
opts:
title: "Thread UID if the build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
- emoji:
opts:
title: "Emoji to use as the icon for the message"
description: |
Optionally you can specify an emoji as the sender
icon. You can use the Ghost icon for example
if you specify `:ghost:` here as an input.
**If you specify an Icon URL then this Emoji input will be ignored!**
- emoji_on_error:
opts:
title: "Emoji to use as the icon for the message if the build failed"
description: |
**This option will be used if the build failed.** If you
leave this option empty then the default one will be used.
category: If Build Failed
- icon_url: "https://github.com/bitrise-io.png"
opts:
title: "Message icon"
description: |
Optionally, you can specify a custom icon image URL
which will be presented as the sender icon.
A square image is recommended,
which can't be larger than 128px in either width or height,
and it must be smaller than 64K in size.
If you specify this input, the **Emoji** input will be ignored!
- icon_url_on_error: "https://github.com/bitrise-io.png"
opts:
title: "Message icon if the build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
- link_names: "yes"
opts:
title: "Linkify channel names and usernames?"
description: |
Linkify names in the message such as `@slackbot` or `#random`
value_options:
- "yes"
- "no"
- from_username: "Bitrise"
opts:
title: "The bot's username for the message"
description: |
The username of the bot user which will be presented as the sender of the message
- from_username_on_error: "Bitrise"
opts:
title: "The bot's username for the message if the build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
# Attachment inputs
- color: "#3bc3a3"
opts:
title: "Message color"
description: |
Color is used to color the border along the left side of the attachment.
Can either be one of good, warning, danger, or any hex color code (eg. #439FE0).
You can find more info about the color and other text formatting
in [Slack's documentation](https://api.slack.com/docs/message-attachments).
is_required: true
- color_on_error: "#f0741f"
opts:
title: "Message color if the build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
- pretext: "*Build Succeeded!*"
opts:
title: "An optional text that appears above the attachment block."
description: "An optional text that appears above the attachment block."
- pretext_on_error: "*Build Failed!*"
opts:
title: "An optional text that appears above the attachment block if the build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
- author_name: $GIT_CLONE_COMMIT_AUTHOR_NAME
opts:
title: "A small text used to display the author's name."
description: "A small text used to display the author's name."
- title: $GIT_CLONE_COMMIT_MESSAGE_SUBJECT
opts:
title: "The title of the attachment"
description: "Title is displayed as larger, bold text near the top of a attachment."
- title_on_error:
opts:
title: "The title of the attachment if the build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
- title_link:
opts:
title: "A URL that will hyperlink the title."
description: "A URL that will hyperlink the title."
- message: $GIT_CLONE_COMMIT_MESSAGE_BODY
opts:
title: "Text is the main text of the attachment"
description: |
Text is the main text of the attachment, and can contain standard message markup.
The content will automatically collapse if it contains 700+ characters or 5+ linebreaks,
and will display a "Show more..." link to expand the content.
- message_on_error: $GIT_CLONE_COMMIT_MESSAGE_BODY
opts:
title: "Text is the main text of the attachment if the build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
- image_url:
opts:
title: "A URL to an image file that will be displayed inside the attachment"
description: |
A URL to an image file that will be displayed inside the attachment.
Supported formats: GIF, JPEG, PNG, and BMP.
Large images will be resized to a maximum width of 400px or a maximum height of 500px.
- image_url_on_error:
opts:
title: "Image URL if build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
- thumb_url:
opts:
title: "A URL to an image file that will be displayed as a thumbnail"
description: |
A URL to an image file that will be displayed as a thumbnail on the right side of a attachment.
Supported formats: GIF, JPEG, PNG, and BMP.
The thumbnail's longest dimension will be scaled down to 75px.
- thumb_url_on_error:
opts:
title: "Thumbnail if the build failed"
description: |
This option will be used if the build failed. If you
leave this option empty then the default one will be used.
category: If Build Failed
- footer: "Bitrise"
opts:
title: "Footer adds some brief text as footer"
description: |
The footer adds some brief text to help contextualize and identify an attachment.
Limited to 300 characters.
- footer_icon: "https://github.com/bitrise-io.png?size=16"
opts:
title: "Renders a small icon beside the footer text"
description: |
Renders a small icon beside the footer text
It will be scaled down to 16px by 16px.
- timestamp: "yes"
opts:
title: "Show the current time as part of the attachment's footer?"
description: "Show the current time as part of the attachment's footer?"
value_options:
- "yes"
- "no"
- fields: |
App|${BITRISE_APP_TITLE}
Branch|${BITRISE_GIT_BRANCH}
Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
opts:
title: "A list of fields to be displayed in a table inside the attachment"
description: |
Fields separated by newlines and each field contains a `title` and a `value`.
The `title` and the `value` fields are separated by a pipe `|` character.
Empty lines and lines without a separator are omitted.
The *title* shown as a bold heading above the `value` text.
The *value* is the text value of the field.
- buttons: |
View App|${BITRISE_APP_URL}
View Build|${BITRISE_BUILD_URL}
Install Page|${BITRISE_PUBLIC_INSTALL_PAGE_URL}
opts:
title: "A list of buttons attached to the message as link buttons"
description: |
Buttons separated by newlines and each field contains a `text` and a `url`.
The `text` and the `url` fields are separated by a pipe `|` character.
Empty lines and lines without a separator are omitted.
The *text* is the label for the button.
The *url* is the fully qualified http or https url to deliver users to.
An attachment may contain 1 to 5 buttons.