File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 24
24
- uses : actions/labeler@v5
25
25
with :
26
26
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
You canโt perform that action at this time.
0 commit comments