-
Notifications
You must be signed in to change notification settings - Fork 16
48 lines (48 loc) · 1.56 KB
/
send-slack-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
name: 'Send Slack notification when PR is merged'
on:
pull_request:
types:
- closed
jobs:
send-slack-notification:
if: github.event.pull_request.merged == true &&
github.event.pull_request.user.login != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Send Slack message
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "A PR was just merged into starter.dev :tada:",
"emoji": true
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ github.event.pull_request.user.login }}* has just contributed to starter.dev :partying_face:"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ github.event.pull_request.user.login }}* made the following changes: <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK