forked from chipsalliance/caliptra-sw
-
Notifications
You must be signed in to change notification settings - Fork 0
25 lines (24 loc) · 839 Bytes
/
slack.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
name: Publish merged PRs on Slack
on:
pull_request_target:
types: [closed]
branches: [main]
jobs:
slack_publish:
runs-on: ubuntu-22.04
if: github.event.pull_request.merged
steps:
- name: publish_message
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BODY: ${{ github.event.pull_request.body }}
PR_URL: ${{ github.event.pull_request.html_url }}
AUTHOR: ${{ github.event.pull_request.user.login }}
run: |
curl ${{ secrets.SLACK_PR_MERGED_WEBHOOK_URL }} \
-H "Content-Type: application/json" \
-d "$(jq -n --arg title "${PR_TITLE}" \
--arg body "${PR_BODY}" \
--arg author "${AUTHOR}" \
--arg url "${PR_URL}" \
'$ARGS.named')"