From dfb0670b6529bbe52a88e4b6311b1aa4207287c4 Mon Sep 17 00:00:00 2001 From: ramong26 Date: Sun, 25 Jan 2026 11:21:06 +0900 Subject: [PATCH 1/4] test: pr description automation --- frontend/test.txt | 1 - test.txt | Bin 0 -> 22 bytes 2 files changed, 1 deletion(-) delete mode 100644 frontend/test.txt create mode 100644 test.txt diff --git a/frontend/test.txt b/frontend/test.txt deleted file mode 100644 index 34344d7..0000000 --- a/frontend/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is a test commit to verify that the Gemini PR bot workflow is working correctly. diff --git a/test.txt b/test.txt new file mode 100644 index 0000000000000000000000000000000000000000..a875cf5035c5d7d805277e39a9f4d59947d16c7d GIT binary patch literal 22 bcmezWFM}bKAqNQa859^288R7o8Mqh#Qt|~8 literal 0 HcmV?d00001 From 0a16fbc9efac54ba3ad264c13126754287d4b6a9 Mon Sep 17 00:00:00 2001 From: ramong26 Date: Sun, 25 Jan 2026 11:26:18 +0900 Subject: [PATCH 2/4] fix: auto-pr description workflow --- .github/scripts/generate-pr-body.sh | 60 +++++++++-------------- .github/workflows/auto-pr-description.yml | 31 ------------ .github/workflows/pr-auto-body.yml | 26 ++++++++++ 3 files changed, 48 insertions(+), 69 deletions(-) delete mode 100644 .github/workflows/auto-pr-description.yml create mode 100644 .github/workflows/pr-auto-body.yml diff --git a/.github/scripts/generate-pr-body.sh b/.github/scripts/generate-pr-body.sh index 0a9c60c..06d5edc 100644 --- a/.github/scripts/generate-pr-body.sh +++ b/.github/scripts/generate-pr-body.sh @@ -1,52 +1,36 @@ #!/bin/bash -TARGET_BRANCH=$1 -SOURCE_BRANCH=$2 -PR_NUMBER=$3 +FILES=$(cat files.txt) +STATS=$(cat diffstat.txt) -echo "Base: $TARGET_BRANCH" -echo "Head: $SOURCE_BRANCH" -echo "PR: #$PR_NUMBER" +PROMPT="너는 CodeRabbit 스타일의 GitHub PR 리뷰 봇이다. +다음 변경 내용을 바탕으로 '한글' Pull Request 본문을 작성해라. -git fetch origin +형식은 반드시 아래를 따를 것: -MERGE_BASE=$(git merge-base origin/$TARGET_BRANCH origin/$SOURCE_BRANCH) +## 📌 Summary +- 이 PR의 목적 요약 -COMMITS=$(git log $MERGE_BASE..origin/$SOURCE_BRANCH --oneline) -DIFF_STATS=$(git diff --stat $MERGE_BASE..origin/$SOURCE_BRANCH) -DIFF_CONTENT=$(git diff $MERGE_BASE..origin/$SOURCE_BRANCH | head -c 12000) +## ✨ Changes +- 주요 변경 사항 나열 -PROMPT="다음 코드 변경사항을 분석해서 GitHub Pull Request 본문을 작성해줘. +## 🧪 Test +- 테스트 여부 또는 확인 방법 -출력은 반드시 아래 형식만 사용: +## ⚠️ Notes +- 리뷰어가 주의해서 볼 점 -## 📝 요약 -(한글로 이 PR의 목적 요약) +변경된 파일 목록: +$FILES -## ✨ 주요 변경사항 -- 변경 사항 목록 - -## 🔍 영향 범위 -- 프론트엔드 / 백엔드 / 설정 등 영향 영역 - -## ✅ 테스트 방법 -- 테스트 방법 요약 - -분석 대상: - -[커밋 목록] -$COMMITS - -[변경 파일 통계] -$DIFF_STATS - -[상세 diff] -$DIFF_CONTENT +변경 통계: +$STATS " -RESPONSE=$(gemini -p "$PROMPT") +RESPONSE=$(npx @google/gemini-cli chat \ + --model=gemini-2.0-flash \ + --prompt "$PROMPT") -echo "===== Gemini Response =====" -echo "$RESPONSE" +echo "$RESPONSE" > pr_body.txt -gh pr edit "$PR_NUMBER" --body "$RESPONSE" +gh pr edit "$PR_NUMBER" --body-file pr_body.txt diff --git a/.github/workflows/auto-pr-description.yml b/.github/workflows/auto-pr-description.yml deleted file mode 100644 index 4089ea6..0000000 --- a/.github/workflows/auto-pr-description.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Auto Generate PR Description with Gemini - -on: - pull_request: - types: [opened] - -jobs: - generate-pr-description: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install GitHub CLI - run: sudo apt-get install gh -y - - - name: Install Gemini CLI - run: npm install -g @google/gemini-cli - - - name: Generate PR description - env: - GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} - GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }} - run: | - bash .github/scripts/generate-pr-body.sh \ - "${{ github.event.pull_request.base.ref }}" \ - "${{ github.event.pull_request.head.ref }}" \ - "${{ github.event.pull_request.number }}" diff --git a/.github/workflows/pr-auto-body.yml b/.github/workflows/pr-auto-body.yml new file mode 100644 index 0000000..85cfbd2 --- /dev/null +++ b/.github/workflows/pr-auto-body.yml @@ -0,0 +1,26 @@ +name: Auto PR Body (Korean + CodeRabbit Style) + +on: + pull_request: + types: [opened, synchronize] + +jobs: + generate-pr-body: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get diff summary + run: | + git fetch origin main + git diff --name-only origin/main...HEAD > files.txt + git diff --stat origin/main...HEAD > diffstat.txt + + - name: Generate PR body with Gemini + env: + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} + GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} + run: bash .github/scripts/generate-pr-body.sh From 41746670bd939c9929100b6d4e16d9fdb80eb2f5 Mon Sep 17 00:00:00 2001 From: ramong26 Date: Sun, 25 Jan 2026 11:28:54 +0900 Subject: [PATCH 3/4] fix: auto-pr --- .github/scripts/generate-pr-body.sh | 6 ++---- .github/workflows/pr-auto-body.yml | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/scripts/generate-pr-body.sh b/.github/scripts/generate-pr-body.sh index 06d5edc..d58b162 100644 --- a/.github/scripts/generate-pr-body.sh +++ b/.github/scripts/generate-pr-body.sh @@ -15,7 +15,7 @@ PROMPT="너는 CodeRabbit 스타일의 GitHub PR 리뷰 봇이다. - 주요 변경 사항 나열 ## 🧪 Test -- 테스트 여부 또는 확인 방법 +- 테스트 방법 또는 확인 사항 ## ⚠️ Notes - 리뷰어가 주의해서 볼 점 @@ -27,9 +27,7 @@ $FILES $STATS " -RESPONSE=$(npx @google/gemini-cli chat \ - --model=gemini-2.0-flash \ - --prompt "$PROMPT") +RESPONSE=$(npx @google/gemini-cli "$PROMPT" --model=gemini-2.0-flash) echo "$RESPONSE" > pr_body.txt diff --git a/.github/workflows/pr-auto-body.yml b/.github/workflows/pr-auto-body.yml index 85cfbd2..3c175b6 100644 --- a/.github/workflows/pr-auto-body.yml +++ b/.github/workflows/pr-auto-body.yml @@ -1,4 +1,4 @@ -name: Auto PR Body (Korean + CodeRabbit Style) +name: Auto PR Body (Korean + CodeRabbit) on: pull_request: @@ -23,4 +23,5 @@ jobs: env: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: bash .github/scripts/generate-pr-body.sh From 5fd3a4cc8c540f8a464752fdbc2f109437597fa7 Mon Sep 17 00:00:00 2001 From: ramong26 Date: Sun, 25 Jan 2026 11:34:34 +0900 Subject: [PATCH 4/4] chore: delete auto pr --- .github/scripts/generate-pr-body.sh | 34 ----------------------------- .github/workflows/pr-auto-body.yml | 27 ----------------------- 2 files changed, 61 deletions(-) delete mode 100644 .github/scripts/generate-pr-body.sh delete mode 100644 .github/workflows/pr-auto-body.yml diff --git a/.github/scripts/generate-pr-body.sh b/.github/scripts/generate-pr-body.sh deleted file mode 100644 index d58b162..0000000 --- a/.github/scripts/generate-pr-body.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -FILES=$(cat files.txt) -STATS=$(cat diffstat.txt) - -PROMPT="너는 CodeRabbit 스타일의 GitHub PR 리뷰 봇이다. -다음 변경 내용을 바탕으로 '한글' Pull Request 본문을 작성해라. - -형식은 반드시 아래를 따를 것: - -## 📌 Summary -- 이 PR의 목적 요약 - -## ✨ Changes -- 주요 변경 사항 나열 - -## 🧪 Test -- 테스트 방법 또는 확인 사항 - -## ⚠️ Notes -- 리뷰어가 주의해서 볼 점 - -변경된 파일 목록: -$FILES - -변경 통계: -$STATS -" - -RESPONSE=$(npx @google/gemini-cli "$PROMPT" --model=gemini-2.0-flash) - -echo "$RESPONSE" > pr_body.txt - -gh pr edit "$PR_NUMBER" --body-file pr_body.txt diff --git a/.github/workflows/pr-auto-body.yml b/.github/workflows/pr-auto-body.yml deleted file mode 100644 index 3c175b6..0000000 --- a/.github/workflows/pr-auto-body.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Auto PR Body (Korean + CodeRabbit) - -on: - pull_request: - types: [opened, synchronize] - -jobs: - generate-pr-body: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Get diff summary - run: | - git fetch origin main - git diff --name-only origin/main...HEAD > files.txt - git diff --stat origin/main...HEAD > diffstat.txt - - - name: Generate PR body with Gemini - env: - GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} - GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} - run: bash .github/scripts/generate-pr-body.sh