generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (33 loc) · 1.16 KB
/
slack_notifier_merged.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
name: "post merged pull to slack"
on:
pull_request:
branches: [main]
types:
- closed
jobs:
slack-pr-merged:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Send GitHub trigger payload to Slack
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"text": ":github-merged: Pull request merged by ${{ github.event.pull_request.user.login }}\n\n<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":github-merged: Pull request merged by ${{ github.event.pull_request.user.login }}\n\n<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK