-
Notifications
You must be signed in to change notification settings - Fork 10
71 lines (69 loc) · 2.09 KB
/
send-notification.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
name: Send Slack notifiactions
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository (only needed for slack_mention_mapping_file)
uses: actions/checkout@v2
- name: Slack notification
uses: tiloio/[email protected]
with:
slack_web_hook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
slack_mention_mapping_file: ./.github/slack-name-mapping.json
slack_json: '{
"username": "{{GITHUB_ACTOR}}",
"text": "{{GITHUB_ACTOR}} made some notification",
"icon_url": "{{CUSTOM_AUTHOR_PICTURE}}",
"channel": "your_channel",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "someone pushed something.\n_{{CUSTOM_COMMIT_MSG}}_"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": ":speech_balloon: commit <{{CUSTOM_COMMIT_URL}}|{{CUSTOM_SHORT_GITHUB_SHA}}>"
}
]
}
]
}'
- name: Slack failure notification
if: ${{ failure() }}
uses: tiloio/[email protected]
with:
slack_web_hook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
slack_json: '{
"username": "{{GITHUB_ACTOR}}",
"text": "{{GITHUB_ACTOR}} made some notification",
"icon_url": "{{CUSTOM_AUTHOR_PICTURE}}",
"channel": "your_channel",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "someone pushed something and it failed!\n_{{CUSTOM_COMMIT_MSG}}_"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": ":speech_balloon: commit <{{CUSTOM_COMMIT_URL}}|{{CUSTOM_SHORT_GITHUB_SHA}}>"
}
]
}
]
}'