Skip to content

Commit df9afb8

Browse files
authored
fix: use env vars and job-level if to avoid parser bug (#23424)
1 parent a537948 commit df9afb8

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Docs PR Review Notify
2+
3+
on:
4+
pull_request:
5+
types: [review_requested]
6+
7+
jobs:
8+
notify:
9+
runs-on: ubuntu-latest
10+
if: github.event.requested_team.slug == 'docs-prs'
11+
steps:
12+
- name: Send Slack notification
13+
env:
14+
SLACK_WEBHOOK: ${{ secrets.SLACK_DOC_REVIEW_WEBHOOK_URL }}
15+
PR_TITLE: ${{ github.event.pull_request.title }}
16+
PR_URL: ${{ github.event.pull_request.html_url }}
17+
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
18+
PR_NUMBER: ${{ github.event.pull_request.number }}
19+
PR_LINES: ${{ github.event.pull_request.additions + github.event.pull_request.deletions }}
20+
run: |
21+
jq -n \
22+
--arg title "$PR_TITLE" \
23+
--arg url "$PR_URL" \
24+
--arg author "$PR_AUTHOR" \
25+
--arg number "$PR_NUMBER" \
26+
--arg lines "$PR_LINES" \
27+
'{pr_title: $title, pr_url: $url, pr_author: $author, pr_number: $number, lines_changed: $lines}' \
28+
| curl -X POST "$SLACK_WEBHOOK" \
29+
-H 'Content-Type: application/json' \
30+
--fail-with-body \
31+
-d @-

0 commit comments

Comments
 (0)