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