diff --git a/.github/workflows/ai-codereviewer.yml b/.github/workflows/ai-codereviewer.yml deleted file mode 100644 index 731e729c..00000000 --- a/.github/workflows/ai-codereviewer.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: AI Code Reviewer - -on: - pull_request: - types: - - opened - - synchronize - -permissions: - pull-requests: write - contents: read - -jobs: - review: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: AI Code Reviewer - uses: harderthan/ai-codereviewer@main - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # The GITHUB_TOKEN is there by default so you just need to keep it like it is and not necessarily need to add it as secret as it will throw an error. [More Details](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret) - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - OPENAI_API_MODEL: "gpt-4" # Optional: defaults to "gpt-4" - exclude: "third_party/*, **/*.json, **/*.md, **/*.txt" diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml new file mode 100644 index 00000000..4c2c86ef --- /dev/null +++ b/.github/workflows/ai-review.yml @@ -0,0 +1,28 @@ +name: AI Code Reviewer + +permissions: + contents: read + pull-requests: write + +on: + pull_request: + pull_request_review_comment: + types: [created] + +concurrency: + group: + ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}-${{ github.event_name == 'pull_request_review_comment' && 'pr_comment' || 'pr' }} + cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }} + +jobs: + review: + runs-on: ubuntu-latest + steps: + - uses: coderabbitai/ai-pr-reviewer@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + with: + debug: false + review_simple_changes: false + review_comment_lgtm: true