-
-
Notifications
You must be signed in to change notification settings - Fork 245
ci: add assign-reviewer job #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
e1f2eb3
cf9d336
7a10e64
c8e1b5f
e1716d0
7844fea
5d394c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,26 @@ jobs: | |
- uses: actions/labeler@v5 | ||
with: | ||
repo-token: ${{ github.token }} | ||
|
||
assign-reviewer: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get previous PR author and assign as reviewer | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
current_repo=${{ github.repository }} | ||
current_pr_num=${{ github.event.number }} | ||
|
||
# 최근 3개의 PR 중 현재 PR 작성자와 다른 작성자 찾기 | ||
previous_pr_author=$(gh pr list --repo $current_repo \ | ||
--search "-is:closed sort:created-desc -author:$current_pr_author" \ | ||
DaleSeo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
--limit 3 --json number,author \ | ||
|
||
--jq 'map(select(.number < '$current_pr_num'))[0].author.login') | ||
|
||
if [ -n "$previous_pr_author" ]; then | ||
gh pr edit $current_pr_num --repo $current_repo --add-reviewer $previous_pr_author | ||
else | ||
echo "❌ No previous PR author found to assign as reviewer" | ||
exit 1 | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.vscode/ | ||
.DS_Store | ||
.env | ||
**/*.iml | ||
|
Uh oh!
There was an error while loading. Please reload this page.