-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction.yml
38 lines (36 loc) · 999 Bytes
/
action.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
name: Slack notification
description: Send Slack messages using WebHooks
inputs:
CHANNEL:
description: Channel to post a message
required: true
MESSAGE:
description: Text message to post
required: true
runs:
using: composite
steps:
- name: Send custom JSON data to Slack workflow
id: slack
if: inputs.CHANNEL != '' && inputs.MESSAGE != ''
uses: slackapi/[email protected]
with:
payload: |
{
"text": "${{ inputs.MESSAGE }}",
"channel": "${{ inputs.CHANNEL }}",
"username": "webhookbot",
"icon_emoji": ":ghost:",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ inputs.MESSAGE }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK