Skip to content

review submitted notification #13

review submitted notification

review submitted notification #13

name: Notify Slack on Pull Request Review Request
on:
pull_request_review:
types: [submitted]
env:
koust6u: U07D1PWSLSG
kelly6bf: U07DSB12K99
JiHyeonL: U07E3T9PMA4
yechop: U07E3TG6CHE
reddevilmidzy: U07DF0QPUKV
dle234: U07E48NCK4G
greetings1012: U07DPGSCXRA
anttiey: U07DPGSCXRA
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get Thread TS from API
id: get_ts
run: |
RESPONSE=$(curl -s -X GET "http://43.200.237.127:8080/github/thread" -H "GITHUB_URL: ${{ github.event.pull_request.html_url }}")
TS=$(echo "$RESPONSE" | jq -r '.ts')
echo "THREAD_TS=$TS" >> $GITHUB_ENV
- name: Send Slack notification
uses: slackapi/[email protected]
with:
channel-id: 'C07DC7DJSKF'
payload: |
{
"text": "Code review requested for Backend PR: ${{ github.event.pull_request.html_url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "📫<@${{ env[format('{0}', env.GITHUB_UID)] }}>님 PR에 대한 리뷰가 도착했어요.📫"
}
}
],
"thread_ts": "${{ env.THREAD_TS }}"
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
GITHUB_UID: ${{ github.event.pull_request.user.login }}