Skip to content

fix(ui): replace [Next] placeholders with → in UI #51

fix(ui): replace [Next] placeholders with → in UI

fix(ui): replace [Next] placeholders with → in UI #51

name: Gemini Code Review
on:
pull_request:
types: [opened, synchronize]
paths:
- 'src/**'
- 'prisma/**'
- 'Controllers/**'
- 'Services/**'
permissions:
contents: read
pull-requests: write
concurrency:
group: gemini-review-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
review:
name: Gemini PR Review
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Gemini CLI
run: npm install -g @google/gemini-cli
- name: Get changed files
id: diff
run: |
FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'src/' 'prisma/' 'Controllers/' 'Services/' | head -50)
echo "files<<EOF" >> $GITHUB_OUTPUT
echo "$FILES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Run Gemini review
if: steps.diff.outputs.files != ''
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
cat <<'PROMPT' > /tmp/review-prompt.txt
You are a senior code reviewer for MemoLib, a legal platform (Next.js + .NET).
Review the following changed files for:
- Security vulnerabilities (SQL injection, XSS, auth bypass)
- Performance issues
- TypeScript type safety
- RGPD compliance concerns
- Breaking changes to API contracts
Changed files:
${{ steps.diff.outputs.files }}
Provide a concise markdown review with severity levels (🔴 Critical, 🟠 High, 🟡 Medium, 🔵 Info).
If no issues found, say "✅ No issues found."
PROMPT
REVIEW=$(gemini -p "$(cat /tmp/review-prompt.txt)" 2>/dev/null || echo "⚠️ Gemini review could not be completed.")
echo "$REVIEW" > /tmp/review-output.md
- name: Post review comment
if: steps.diff.outputs.files != ''
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const review = fs.readFileSync('/tmp/review-output.md', 'utf8');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `## 🤖 Gemini Code Review\n\n${review}\n\n---\n*Automated review by Gemini CLI*`
});