-
-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (49 loc) · 1.75 KB
/
main.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
name: Notify about PRs
on:
pull_request:
types: [opened, reopened]
pull_request_target:
types: [opened, reopened]
jobs:
notify_slack:
runs-on: ubuntu-latest
steps:
- name: Send alert to Slack
id: slack
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload: |
{
"text": "GitHub Pull Request opened in: ${{ github.event.repository.name }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Pull Request opened in: ${{ github.event.repository.name }} \n#${{ github.event.pull_request.number }} <${{ github.event.pull_request.html_url}}|${{ github.event.pull_request.title }}>"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "By ${{ github.event.pull_request.author_association }}: <${{ github.event.pull_request.user.html_url }}|${{ github.event.pull_request.user.login }}>\n\n"
},
"accessory": {
"type": "image",
"image_url": "${{ github.event.pull_request.user.avatar_url }}",
"alt_text": "Avatar"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ${{ toJSON(github.event.pull_request.body) }}
}
}
]
}