From 6eb23a98b6d233e1a8a6d2c2489ef69870eb04b9 Mon Sep 17 00:00:00 2001 From: thias15 Date: Sat, 1 Jun 2024 19:54:50 -0700 Subject: [PATCH] Update and rename ai_reviewer.yml to gpt_review.yml (#422) --- .github/workflows/ai_reviewer.yml | 25 ------------------------- .github/workflows/gpt_review.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/ai_reviewer.yml create mode 100644 .github/workflows/gpt_review.yml diff --git a/.github/workflows/ai_reviewer.yml b/.github/workflows/ai_reviewer.yml deleted file mode 100644 index e329de61f..000000000 --- a/.github/workflows/ai_reviewer.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Code Review GPT - -on: - pull_request: - types: - - opened - - synchronize - branches: [master] - -jobs: - run_code_review: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Code Review GPT - uses: mattzcarey/code-review-gpt@v0.1.8 - with: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - MODEL: 'gpt-4o' - GITHUB_TOKEN: ${{ github.token }} - - diff --git a/.github/workflows/gpt_review.yml b/.github/workflows/gpt_review.yml new file mode 100644 index 000000000..9fb5c52a7 --- /dev/null +++ b/.github/workflows/gpt_review.yml @@ -0,0 +1,26 @@ +name: GPT Review + +on: + issue_comment: + types: [created] + +jobs: + gpt_review: + if: github.actor == 'thias15' + runs-on: ubuntu-latest + steps: + - name: Run GPT Code Review + if: | + contains(github.event.comment.body, '/gpt-review') || + contains(github.event.comment.body, '/gr') + uses: cirolini/genai-code-review@v2 + with: + openai_api_key: ${{ secrets.OPENAI_API_KEY }} + github_token: ${{ secrets.GITHUB_TOKEN }} + github_pr_id: ${{ github.event.number }} + openai_model: "gpt-4o" # optional + openai_temperature: 0.5 # optional + openai_max_tokens: 2048 # optional + mode: files # files or patch + language: en # optional, default is 'en' + custom_prompt: "" # optional