Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO-NOT-MERGE: Test workflow #235

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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