-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Internal] Adds approval as a feed notification. (#39450)
* add approval to feed * appease yamllint
- Loading branch information
1 parent
e6438dd
commit 58d9b6d
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Pull Request Review | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
pull_request_review: | ||
types: [submitted] | ||
|
||
jobs: | ||
approved: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Community Check | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
sparse-checkout: .github/actions/community_check | ||
|
||
- name: Run Community Check | ||
id: community_check | ||
uses: ./.github/actions/community_check | ||
with: | ||
user_login: ${{ github.event.review.user.login }} | ||
maintainers: ${{ secrets.MAINTAINERS }} | ||
partners: ${{ secrets.PARTNERS }} | ||
|
||
- name: Maintainer Approval | ||
if: | | ||
github.event.review.state == 'approved' | ||
&& (steps.community_check.outputs.maintainer == 'true' || steps.community_check.outputs.partner == 'true') | ||
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 | ||
env: | ||
REVIEW_AUTHOR_URL: ${{ github.event.review.user.html_url }} | ||
REVIEW_AUTHOR_LOGIN: ${{ github.event.review.user.login }} | ||
PR_HTML_URL: ${{ github.event.pull_request.html_url }} | ||
PR_TITLE: ${{ github.event.pull_request.title }} | ||
SLACK_WEBHOOK_URL: ${{ secrets.FEED_SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
with: | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ${{ toJSON(format(':bufo-approves: <{0}|{1}> approved <{2}|{3}>', env.REVIEW_AUTHOR_URL, env.REVIEW_AUTHOR_LOGIN, env.PR_HTML_URL, env.PR_TITLE)) }} | ||
} | ||
} | ||
] | ||
} |