Skip to content

Commit f7a3bea

Browse files
committed
ci: add assign-reviewer job
- PR ๋ฆฌ๋ทฐ์–ด๋ฅผ ์ž๋™ ํ• ๋‹นํ•˜๋Š” automation job ์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. - ๋ฆฌ๋ทฐ์–ด ์ฐพ๊ธฐ ์กฐ๊ฑด - ํ˜„์žฌ PR ๋ณด๋‹ค ์ด์ „์— ์ƒ์„ฑ๋œ PR ์ด์–ด์•ผ ํ•จ - Closed PR ์€ ์ œ์™ธํ•ด์•ผ ํ•จ (์‹ค์ˆ˜๋กœ ์˜ฌ๋ ธ๋‹ค ๋‹ซ๋Š” ๊ฒฝ์šฐ๊ฐ€ ์ข…์ข… ์žˆ์œผ๋ฏ€๋กœ) - ์ฐพ์€ PR ์ค‘ ํ˜„์žฌ PR๊ณผ ๊ฐ€์žฅ ๊ทผ์ ‘ํ•œ PR์˜ ์ž‘์„ฑ์ž์—ฌ์•ผ ํ•จ - ํ˜„์žฌ PR๊ณผ ๋‹ค๋ฅธ ์ด๋ฆ„์˜ ์ž‘์„ฑ์ž์—ฌ์•ผ ํ•จ
1 parent e1f2eb3 commit f7a3bea

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

โ€Ž.github/workflows/automation.yamlโ€Ž

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,26 @@ jobs:
2424
- uses: actions/labeler@v5
2525
with:
2626
repo-token: ${{ github.token }}
27+
28+
assign-reviewer:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Get previous PR author and assign as reviewer
32+
env:
33+
GITHUB_TOKEN: ${{ github.token }}
34+
run: |
35+
current_repo=${{ github.repository }}
36+
current_pr_num=${{ github.event.number }}
37+
38+
# ์ตœ๊ทผ 3๊ฐœ์˜ PR ์ค‘ ํ˜„์žฌ PR ์ž‘์„ฑ์ž์™€ ๋‹ค๋ฅธ ์ž‘์„ฑ์ž ์ฐพ๊ธฐ ()
39+
previous_pr_author=$(gh pr list --repo $current_repo \
40+
--search "number:<$current_pr_num -is:closed sort:created-desc -author:$current_pr_author" \
41+
--limit 3 --json number,author \
42+
--jq '.[0].author.login')
43+
44+
if [ -n "$previous_pr_author" ]; then
45+
gh pr edit $current_pr_num --repo $current_repo --add-reviewer $previous_pr_author
46+
else
47+
echo "โŒ No previous PR author found to assign as reviewer"
48+
exit 1
49+
fi

0 commit comments

Comments
ย (0)