diff --git a/.github/workflows/on-comment-llm-reviewer.yml b/.github/workflows/on-comment-llm-reviewer.yml new file mode 100644 index 00000000..31d57fbd --- /dev/null +++ b/.github/workflows/on-comment-llm-reviewer.yml @@ -0,0 +1,34 @@ +name: LLM Code Reviewer + +on: + issue_comment: + types: [created] + +permissions: write-all + +jobs: + gemini-code-review: + runs-on: ubuntu-latest + if: | + github.event.issue.pull_request && + contains(github.event.comment.body, '/gemini-review') + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get PR Details + id: pr + run: | + PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.issue.number }}) + echo "head_sha=$(echo $PR_JSON | jq -r .head.sha)" >> $GITHUB_OUTPUT + echo "base_sha=$(echo $PR_JSON | jq -r .base.sha)" >> $GITHUB_OUTPUT + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: truongnh1992/gemini-ai-code-reviewer@6.2.0 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} + INPUT_EXCLUDE: "*.md,*.txt,package-lock.json,*.yml,*.yaml" \ No newline at end of file diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index de343109..ea7f1059 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -183,4 +183,4 @@ jobs: needs: [publish-dev] with: channel: ${{ needs.publish-dev.outputs.devChannel }} - secrets: inherit + secrets: inherit \ No newline at end of file