Skip to content

Commit 8eba85a

Browse files
Merge pull request #63 from open-sciencelab/revert-62-revert-60-gemini-reviewer
Revert "Revert "ci: add code reviewer""
2 parents 7ef2ecb + a364659 commit 8eba85a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/code-review.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Gemini AI Code Reviewer
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
permissions: write-all
8+
9+
jobs:
10+
gemini-code-review:
11+
runs-on: ubuntu-latest
12+
if: |
13+
github.event.issue.pull_request &&
14+
contains(github.event.comment.body, '/gemini-review')
15+
steps:
16+
- name: PR Info
17+
run: |
18+
echo "Comment: ${{ github.event.comment.body }}"
19+
echo "Issue Number: ${{ github.event.issue.number }}"
20+
echo "Repository: ${{ github.repository }}"
21+
22+
- name: Checkout Repo
23+
uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Get PR Details
28+
id: pr
29+
run: |
30+
PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.issue.number }})
31+
echo "head_sha=$(echo $PR_JSON | jq -r .head.sha)" >> $GITHUB_OUTPUT
32+
echo "base_sha=$(echo $PR_JSON | jq -r .base.sha)" >> $GITHUB_OUTPUT
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- uses: truongnh1992/gemini-ai-code-reviewer@main
37+
with:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
40+
GEMINI_MODEL: gemini-2.5-flash # Optional, default is `gemini-2.5-flash`
41+
EXCLUDE: "*.md,*.txt,package-lock.json,*.yml,*.yaml"

0 commit comments

Comments
 (0)