Skip to content

[TTAHUB-2681] Unfurl production PR links in slack notifications #11

[TTAHUB-2681] Unfurl production PR links in slack notifications

[TTAHUB-2681] Unfurl production PR links in slack notifications #11

name: Pull Request Notifications
on:
pull_request:
# branches:
# - production
types: [opened, ready_for_review, closed, reopened]
jobs:
# notify_slack:
# runs-on: ubuntu-latest
# steps:
# - name: Notify slack when a PR to production is opened
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# run: |
# PR_LINK="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/pull/${{ github.event.pull_request.number }}"
# curl -X POST -H 'Content-type: application/json' --data "{\"text\": \":rocket: A pull request (#${{ github.event.pull_request.number }}) to *production* is now open! <${PR_LINK}|Click here to view the PR>\"}" $SLACK_WEBHOOK_URL
notify_slack_any_pr:
runs-on: ubuntu-latest
# if: github.event.action == 'opened'
steps:
- name: Notify second Slack channel for any PR opened
env:
SLACK_WEBHOOK_URL_TEST: ${{ secrets.SLACK_WEBHOOK_URL_TEST }}
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<https://github.com/HHS/Head-Start-TTADP/pull/2068|PR #2068: New feature>",
"unfurl_links": true
}
}
]
}' $SLACK_WEBHOOK_URL_TEST