-
Notifications
You must be signed in to change notification settings - Fork 478
31 lines (29 loc) · 1.11 KB
/
docs-pr-review-notify.yml
File metadata and controls
31 lines (29 loc) · 1.11 KB
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
name: Docs PR Review Notify
on:
pull_request:
types: [review_requested]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
if: github.event.requested_team.slug == 'docs-prs'
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_DOC_REVIEW_WEBHOOK_URL }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_LINES: ${{ github.event.pull_request.additions + github.event.pull_request.deletions }}
run: |
jq -n \
--arg title "$PR_TITLE" \
--arg url "$PR_URL" \
--arg author "$PR_AUTHOR" \
--arg number "$PR_NUMBER" \
--arg lines "$PR_LINES" \
'{pr_title: $title, pr_url: $url, pr_author: $author, pr_number: $number, lines_changed: $lines}' \
| curl -X POST "$SLACK_WEBHOOK" \
-H 'Content-Type: application/json' \
--fail-with-body \
-d @-