forked from bitrise-steplib/steps-slack-message
-
Notifications
You must be signed in to change notification settings - Fork 0
/
step.yml
295 lines (261 loc) · 10.4 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
---
title: Send a Slack message
summary: Send a [Slack](https://slack.com/) message to a channel or group.
description: |
Send a [Slack](https://slack.com/) message to a channel or group.
You have to register an **Incoming WebHook integration** at:
https://**YOURTEAMNAME**.slack.com/services
On the WebHook integration's page copy the **Webhook URL**.
*Don't forget to enable this Step to **Always run** if
you want to get notified about failed builds as well!*
website: https://github.com/bitrise-io/steps-slack-message
source_code_url: https://github.com/bitrise-io/steps-slack-message
support_url: https://github.com/bitrise-io/steps-slack-message/issues
host_os_tags:
- osx-10.10
- ubuntu-14.04
type_tags:
- notification
is_requires_admin_user: false
is_always_run: true
is_skippable: true
deps:
brew:
- name: go
apt_get:
- name: golang
bin_name: go
toolkit:
go:
package_name: github.com/bitrise-io/steps-slack-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: "Slack Webhook URL"
is_required: true
is_sensitive: true
- channel:
opts:
title: "Target Slack channel, group or username"
description: |
Can be an encoded ID, or the channel's name.
Examples:
* channel ID: C024BE91L
* channel: #general
* username: @username
- channel_on_error:
opts:
title: "Target Slack channel, group or username if the build failed"
description: |
* channel example: #general
* username example: @username
category: If Build Failed
- text:
opts:
title: "Text of the message to send."
description: |
Text of the message to send.
Required, unless providing only attachments instead.
- text_on_error:
opts:
title: "Text of the message to send, 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 a Slack 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: "URL to an image to use as the icon for the message."
description: |
Optionally you can specify a custom icon image URL
which will be presented as the sender icon.
Slack recommends an image a square image,
which can't be larger than 128px in width nor in height,
and it must be smaller than 64K in size.
Slack custom emoji guideline: [https://slack.zendesk.com/hc/en-us/articles/202931348-Using-emoji-and-emoticons](https://slack.zendesk.com/hc/en-us/articles/202931348-Using-emoji-and-emoticons)
*If you specify this input, the Emoji input will be ignored!*
- icon_url_on_error: "https://github.com/bitrise-io.png"
opts:
title: "URL to an image 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
- 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 one which should 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.