From e1f2eb319eb73d4c3268619347f7f08a88fec656 Mon Sep 17 00:00:00 2001 From: bky373 Date: Sun, 13 Oct 2024 11:50:02 +0900 Subject: [PATCH 1/7] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d2a36c905..31e3c424d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .vscode/ .DS_Store .env +**/*.iml From cf9d336fc0e5364a6ecddd45dec742368504d683 Mon Sep 17 00:00:00 2001 From: bky373 Date: Sun, 13 Oct 2024 11:50:41 +0900 Subject: [PATCH 2/7] ci: add assign-reviewer job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PR 리뷰어를 자동 할당하는 automation job 을 추가합니다. - 리뷰어 찾기 조건 - 현재 PR 보다 이전에 생성된 PR 이어야 함 - Closed PR 은 제외해야 함 (실수로 올렸다 닫는 경우가 종종 있으므로) - 찾은 PR 중 현재 PR과 가장 근접한 PR의 작성자여야 함 - 현재 PR과 다른 이름의 작성자여야 함 --- .github/workflows/automation.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/automation.yaml b/.github/workflows/automation.yaml index 943175cf0..b8c077c44 100644 --- a/.github/workflows/automation.yaml +++ b/.github/workflows/automation.yaml @@ -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 "number:<$current_pr_num -is:closed sort:created-desc -author:$current_pr_author" \ + --limit 3 --json number,author \ + --jq '.[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 From 7a10e64cf2016b6d8b0237000ec115d73568b5b4 Mon Sep 17 00:00:00 2001 From: bky373 Date: Sun, 13 Oct 2024 12:58:34 +0900 Subject: [PATCH 3/7] =?UTF-8?q?ci:=20json=20=ED=8C=8C=EC=8B=B1=EC=8B=9C=20?= =?UTF-8?q?number=20=ED=95=84=EB=93=9C=20=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/automation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automation.yaml b/.github/workflows/automation.yaml index b8c077c44..2082f6c7d 100644 --- a/.github/workflows/automation.yaml +++ b/.github/workflows/automation.yaml @@ -38,7 +38,7 @@ jobs: # 최근 3개의 PR 중 현재 PR 작성자와 다른 작성자 찾기 previous_pr_author=$(gh pr list --repo $current_repo \ --search "number:<$current_pr_num -is:closed sort:created-desc -author:$current_pr_author" \ - --limit 3 --json number,author \ + --limit 3 --json author \ --jq '.[0].author.login') if [ -n "$previous_pr_author" ]; then From c8e1b5f4d0892198a8ca3ed561a0ef97eb2d8185 Mon Sep 17 00:00:00 2001 From: bky373 Date: Sun, 13 Oct 2024 21:00:54 +0900 Subject: [PATCH 4/7] =?UTF-8?q?ci:=20PR=20number=20=EB=B9=84=EA=B5=90=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/automation.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/automation.yaml b/.github/workflows/automation.yaml index 2082f6c7d..aa89d4dfd 100644 --- a/.github/workflows/automation.yaml +++ b/.github/workflows/automation.yaml @@ -37,10 +37,10 @@ jobs: # 최근 3개의 PR 중 현재 PR 작성자와 다른 작성자 찾기 previous_pr_author=$(gh pr list --repo $current_repo \ - --search "number:<$current_pr_num -is:closed sort:created-desc -author:$current_pr_author" \ - --limit 3 --json author \ - --jq '.[0].author.login') - + --search "-is:closed sort:created-desc -author:$current_pr_author" \ + --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 From e1716d079d2f99a66477c178f4e6145669797e4c Mon Sep 17 00:00:00 2001 From: bky373 Date: Sun, 27 Oct 2024 22:57:14 +0900 Subject: [PATCH 5/7] =?UTF-8?q?ci:=20PR=20=EC=9E=91=EC=84=B1=EC=9E=90=20?= =?UTF-8?q?=ED=83=90=EC=83=89=20=EC=A1=B0=EA=B1=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/automation.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/automation.yaml b/.github/workflows/automation.yaml index aa89d4dfd..d1ba9d81e 100644 --- a/.github/workflows/automation.yaml +++ b/.github/workflows/automation.yaml @@ -35,11 +35,13 @@ jobs: current_repo=${{ github.repository }} current_pr_num=${{ github.event.number }} - # 최근 3개의 PR 중 현재 PR 작성자와 다른 작성자 찾기 + # 직전 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 \ - --jq 'map(select(.number < '$current_pr_num'))[0].author.login') + --state all \ + --search "created:<${{ github.event.pull_request.created_at }} sort:created-desc -author:${{ github.actor }}" \ + --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 From 7844feafa49ad97cba41479a9de947934a2ca7f5 Mon Sep 17 00:00:00 2001 From: bky373 Date: Sun, 10 Nov 2024 09:51:27 +0900 Subject: [PATCH 6/7] ci: update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 31e3c424d..d2a36c905 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ .vscode/ .DS_Store .env -**/*.iml From 5d394c2d048ed6e28ff2d0e27ae4b72b0641186e Mon Sep 17 00:00:00 2001 From: bky373 Date: Sun, 10 Nov 2024 09:52:08 +0900 Subject: [PATCH 7/7] =?UTF-8?q?ci:=20=EC=A3=BC=EC=84=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/automation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automation.yaml b/.github/workflows/automation.yaml index d1ba9d81e..238884884 100644 --- a/.github/workflows/automation.yaml +++ b/.github/workflows/automation.yaml @@ -35,7 +35,7 @@ jobs: current_repo=${{ github.repository }} current_pr_num=${{ github.event.number }} - # 직전 PR 중에서 현재 PR 작성자와 다른 작성자 찾기 + # 이전 PR 중에서 현재 PR 작성자와 다른 작성자 찾기 previous_pr_author=$(gh pr list --repo $current_repo \ --state all \ --search "created:<${{ github.event.pull_request.created_at }} sort:created-desc -author:${{ github.actor }}" \