You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,11 +24,13 @@ The recommended way to use this action is with Slack's Workflow Builder (if you'
24
24
25
25
> ❗️ This approach requires a paid Slack plan; it also doesn't support any text formatting
26
26
27
-
This technique sends data into Slack via a webhook URL created using [Slack's Workflow builder](https://slack.com/features/workflow-automation). Follow [these steps to create a Slack workflow using webhooks][create-webhook]. The Slack workflow webhook URL will be in the form `https://hooks.slack.com/workflows/....`. The payload sent by this GitHub action will be flattened (all nested keys moved to the top level) and stringified since Slack's workflow builder only supports top level string values in payloads.
27
+
This technique sends data into Slack via a webhook URL created using [Slack's Workflow builder](https://slack.com/features/workflow-automation). Follow [these steps to create a Slack workflow using webhooks][create-webhook]. The Slack workflow webhook URL will be in the form `https://hooks.slack.com/workflows/....`.
28
28
29
29
As part of the [workflow setup](https://slack.com/help/articles/360041352714-Create-more-advanced-workflows-using-webhooks#workflow-setup),
30
30
you will need to define expected variables in the payload the webhook will receive (described in the "Create custom variables" section of the docs). If these variables are missing in the payload, an error is returned.
31
31
32
+
To match the webhook input format expected by Workflow Builder, the payload will be flattened and stringified (all nested keys are moved to the top level) before being sent. The default delimiter used to flatten payloads is a period (".") but should be changed to an underscore ("_") using the `payload-delimiter` parameter if you're using nested payloads as input values in your own workflows.
33
+
32
34
#### Setup
33
35
34
36
*[Create a Slack workflow webhook][create-webhook].
@@ -44,6 +46,8 @@ Add this Action as a [step][job-step] to your project's GitHub Action Workflow f
44
46
- name: Send GitHub Action trigger data to Slack workflow
Copy file name to clipboardExpand all lines: action.yml
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@ inputs:
10
10
payload: # JSON payload to send to Slack via webhook
11
11
description: 'JSON payload to send to Slack if webhook route. If not supplied, json from GitHub event will be sent instead'
12
12
required: false
13
+
payload-delimiter: # custom delimiter used to flatten nested values in the JSON payload
14
+
description: 'Custom delimiter used to flatten nested values in the JSON payload. If not supplied, defaults to a period (".").'
15
+
required: false
13
16
payload-file-path: # path to JSON payload to send to Slack via webhook
14
17
description: 'path to JSON payload to send to Slack if webhook route. If not supplied, json from GitHub event will be sent instead. If payload is provided, it will take preference over this field'
0 commit comments