-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
�chore: PR 리뷰어 선정 시 Slack 연동, CodeRabbit AI PR 리뷰 설정 워크플로우 추가해요.
- Loading branch information
1 parent
9883d11
commit 4d9240d
Showing
3 changed files
with
91 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,20 @@ | ||
name: AI-based PR Reviewer with CodeRabbit | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
ai_pr_reviewer: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: CodeRabbit AI Review | ||
uses: coderabbitai/[email protected] | ||
with: | ||
language: 'ko' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,67 @@ | ||
name: PR Reviewer Notification | ||
|
||
on: | ||
pull_request: | ||
types: [review_requested] | ||
|
||
jobs: | ||
specific_review_requested: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get Reviewers List | ||
id: reviewers | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const fs = require('fs'); | ||
const workers = JSON.parse(fs.readFileSync('.github/workflows/reviewers.json')); | ||
const mention = context.payload.pull_request.requested_reviewers.map((user) => { | ||
const login = user.login; | ||
const mappedValue = workers[login]; | ||
return mappedValue ? <@${mappedValue}> : No mapping found for ${login}; | ||
}); | ||
return mention.join(', '); | ||
result-encoding: string | ||
|
||
- name: Send Slack Notification | ||
id: slack_notification | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.PR_NOTI_CHANNEL }} | ||
payload: | | ||
{ | ||
"text": "pr review request", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "리뷰어로 할당되었습니다.\n • 제목: ${{ github.event.pull_request.title }}\n • 리뷰어: ${{ steps.reviewers.outputs.result }}\n • 링크: <${{ github.event.pull_request.html_url }}|리뷰하러 가기>" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.PR_BOT_TOKEN }} | ||
|
||
- name: Comment on Slack Thread | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.PR_NOTI_CHANNEL }} | ||
payload: | | ||
{ | ||
"text": "PR 코멘트 알림", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "| *작성자*: @${{ github.event.comment.user.login }}\n| *코멘트 내용*: _${{ github.event.comment.body }}_\n| *관련 PR*: <${{ github.event.issue.html_url }}|${{ github.event.issue.title }}>" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.PR_BOT_TOKEN }} |
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,4 @@ | ||
{ | ||
"minseong0324": "U083UEXJLLC", | ||
"kongnayeon": "U083BDHR279" | ||
} |