chore: Sends notification to team Slack channel #78
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Notify Docs team | |
on: | |
pull_request: | |
types: [opened, ready_for_review] | |
jobs: | |
check: | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
outputs: | |
files: ${{ steps.changes.outputs.files }} | |
steps: | |
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | |
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 | |
id: changes | |
with: | |
filters: | | |
files: | |
- '.changelog/**' | |
- 'website/**' | |
slack-notification: | |
needs: check | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write # Needed by sticky-pull-request-comment | |
steps: | |
- uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e | |
env: | |
login: ${{ github.event.pull_request.user.login }} | |
email: ${{ github.event.pull_request.user.email }} | |
name: ${{ github.event.pull_request.user.name }} | |
id: ${{ github.event.pull_request.user.id }} | |
node_id: ${{ github.event.pull_request.user.node_id }} | |
avatar_url: ${{ github.event.pull_request.user.avatar_url }} | |
gravatar_id: ${{ github.event.pull_request.user.gravatar_id }} | |
url: ${{ github.event.pull_request.user.url }} | |
html_url: ${{ github.event.pull_request.user.html_url }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_TEST }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
with: | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "<${{ github.event.pull_request.user.html_url }}|${{ github.event.pull_request.user.login }}> has ready for review <${{ github.event.pull_request.html_url }}>|TF PR ${{ github.event.pull_request.number }}" | |
} | |
} | |
] | |
} | |
- uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 | |
with: | |
header: pr-title-slack-doc | |
append: true | |
message: "APIx bot: a message has been sent to Docs Slack channel" |