Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
--limit 3 --json number,author \
Copy link
Contributor Author

@bky373 bky373 Oct 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 number 는 조회하지 않아도 되겠네요 이것저것 테스트해보다 넣었는데 ㅎㅎ 빼겠습니다 -> 7a10e64 완료

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

search 옵션에서 pr number 를 따로 사용할 수 없어서, c8e1b5f 에서 pr num 비교하는 부분을 변경하였습니다.

--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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.vscode/
.DS_Store
.env
**/*.iml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 건 왜 추가되는 거에요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 제가 인텔리제이 IDE를 사용해서 작업하였는데 인텔리제이 모듈이 자동으로 생성되어 추가했었습니다
요건 크게 의미있지는 않으니 제거하고 머지하겠습니당!