-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (44 loc) · 1.12 KB
/
slack-notification.yaml
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
name: Slack Notification
on:
workflow_call:
inputs:
header-text:
description: "Message Header"
required: true
type: string
message:
description: "Message"
required: true
type: string
secrets:
SLACK_WEBHOOK_URL: { required: true }
jobs:
slack-notifications:
runs-on: ubuntu-latest
steps:
- name: slack-notification
uses: slackapi/slack-github-action@v1.23.0
with:
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${{ inputs.header-text }}",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ inputs.message }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK