From 7931d1e2624edf213f1856fe15f3b3fa8cee1361 Mon Sep 17 00:00:00 2001 From: Kazumasa Shimomura Date: Tue, 7 May 2024 16:36:08 +0900 Subject: [PATCH] internal: add pr agent --- .../{ai_review.yml => code_butler.yml} | 4 ++-- .github/workflows/pr_agent.yml | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) rename .github/workflows/{ai_review.yml => code_butler.yml} (84%) create mode 100644 .github/workflows/pr_agent.yml diff --git a/.github/workflows/ai_review.yml b/.github/workflows/code_butler.yml similarity index 84% rename from .github/workflows/ai_review.yml rename to .github/workflows/code_butler.yml index a227b00..f091441 100644 --- a/.github/workflows/ai_review.yml +++ b/.github/workflows/code_butler.yml @@ -10,7 +10,7 @@ on: jobs: review: - if: startsWith(github.event.comment.body, '/review') + if: startsWith(github.event.comment.body, '/butler-review') runs-on: ubuntu-latest steps: - uses: ca-dp/code-butler@v1 @@ -21,7 +21,7 @@ jobs: lang: ja model: gpt-4-turbo-2024-04-09 chat: - if: startsWith(github.event.comment.body, '/chat') + if: startsWith(github.event.comment.body, '/butler-chat') runs-on: ubuntu-latest steps: - uses: ca-dp/code-butler@v1 diff --git a/.github/workflows/pr_agent.yml b/.github/workflows/pr_agent.yml new file mode 100644 index 0000000..90d6354 --- /dev/null +++ b/.github/workflows/pr_agent.yml @@ -0,0 +1,22 @@ +on: + issue_comment: + types: [created] + +jobs: + pr_agent_job: + if: startsWith(github.event.comment.body, '/pragent-review') + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + contents: write + name: Run pr agent on every pull request, respond to user comments + steps: + - name: PR Agent action step + id: pragent + uses: Codium-ai/pr-agent@main + env: + OPENAI_KEY: ${{ secrets.OPENAI_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_REVIEWER.EXTRA_INSTRUCTIONS: 'Please use Japanese in descriptions.' + PR_DESCRIPTION.EXTRA_INSTRUCTIONS: 'Please use Japanese in descriptions. Titles should have prefix of commitlint pattern such as `feat:`, `chore:`, `test:`, `fix:`, `ci:`, `docs:` etc'