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
35 changes: 35 additions & 0 deletions .github/workflows/notify-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Slack notification - reviewer assigned
on:
pull_request:
# only need to trigger when someone has been assigned as a reviewer
types: [review_requested]

jobs:
get-pr-info-and-notify:
runs-on: ubuntu-latest
steps:

- name: "Extract PR details"
id: pr_details
run: |
echo "REVIEWERS=$(jq -r '.pull_request.requested_reviewers | map(.login) | join(", @")' $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
echo "PR_TITLE=$(jq -r '.pull_request.title' $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
echo "PR_URL=$(jq -r '.pull_request.html_url' $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
env:
GITHUB_EVENT_PATH: ${{ github.event_path }}

- name: "Slack notification"
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: trallard-test-channel
SLACK_COLOR: "#7868E6"
SLACK_TITLE: "Code Review Requested"
SLACK_MESSAGE: |
${{ env.REVIEWERS }} has been assiigned as a reviewer for the following PR:
*PR Title*: ${{ env.PR_TITLE }}
*PR URL*: ${{ env.PR_URL }}
SLACK_USERNAME: "GH-bot"
SLACK_ICON_EMOJI: ":bell:"
SLACK_LINK_NAMES: true
MSG_MINIMAL: event