Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/slack-notify-doc-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Notify Slack on Doc Review Request

on:
pull_request:
types: [review_requested]

jobs:
notify-slack:
# Only run if docs-prs team was requested as reviewer
if: github.event.requested_team.slug == 'docs-prs'
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
env:
SLACK_WEBHOOK_URL: ${{ 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 }}
LINES_CHANGED: ${{ 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 "$LINES_CHANGED" \
'{pr_title: $title, pr_url: $url, pr_author: $author, pr_number: $number, lines_changed: $lines}' \
| curl -X POST "$SLACK_WEBHOOK_URL" \
-H 'Content-Type: application/json' \
--fail-with-body \
-d @-
Loading