Skip to content

Commit 5adc49d

Browse files
authored
Merge pull request #284 from GREENRAT-K405/dev
add missing pr-review.yaml file
2 parents febb68d + 8de285b commit 5adc49d

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/PR-review.yaml

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

0 commit comments

Comments
 (0)