woocommerce/.github/workflows/test-assistant-pr-review.yml

49 lines
2.1 KiB
YAML
Raw Normal View History

name: Send PRs that require review to Slack
on:
pull_request_target:
types: [review_requested]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
permissions: {}
jobs:
send-pr-to-slack-for-review:
runs-on: ubuntu-20.04
env:
WOO_PR_TESTING_REVIEW_TEAM: ${{ secrets.WOO_PR_TESTING_REVIEW_TEAM }}
steps:
- name: Send ping to Slack for a new review
uses: archive/github-actions-slack@d9dae40827adf93bddf939db6552d1e392259d7d
id: notify-review
if: |
(github.event_name == 'pull_request' || github.event_name == 'pull_request_target') &&
github.event.action == 'review_requested' &&
github.event.requested_team.slug == env.WOO_PR_TESTING_REVIEW_TEAM
with:
slack-bot-user-oauth-access-token: ${{ secrets.TEST_ASSISTANCE_BOT_TOKEN }}
slack-channel: ${{ secrets.WOO_PR_TESTING_REVIEW_SLACK_CHANNEL }}
slack-text: |
<!subteam^${{ secrets.WOO_PR_TESTING_REVIEW_TEAM_ID }}> was asked to review this PR:
<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}> :thread:
slack-optional-unfurl_links: false
slack-optional-unfurl_media: false
- name: Send ping to Slack about a new comment
uses: archive/github-actions-slack@d9dae40827adf93bddf939db6552d1e392259d7d
id: notify-comment
if: |
(github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment') &&
contains(github.event.comment.body, env.WOO_PR_TESTING_REVIEW_TEAM)
with:
slack-bot-user-oauth-access-token: ${{ secrets.TEST_ASSISTANCE_BOT_TOKEN }}
slack-channel: ${{ secrets.WOO_PR_TESTING_REVIEW_SLACK_CHANNEL }}
slack-text: |
<!subteam^${{ secrets.WOO_PR_TESTING_REVIEW_TEAM_ID }}> was mentioned in a comment:
<${{ github.event.comment.html_url }}|${{ github.event.issue.title }}> :speech_balloon:
slack-optional-unfurl_links: false
slack-optional-unfurl_media: false