name: AI Code Review (Frontend / SPA)
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'src/**'
- 'components/**'
- 'pages/**'
- 'app/**'
- 'hooks/**'
- 'stores/**'
- 'styles/**'
- 'public/**'
- '*.config.ts'
- '*.config.js'
- '*.config.mjs'
- 'tsconfig*.json'
- 'package*.json'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
review:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Download rs-guard
run: |
set -euo pipefail
curl -L --fail -o rs-guard-x86_64-unknown-linux-gnu \
https://github.com/nebulaideas/rs-guard/releases/download/v1.0.0/rs-guard-x86_64-unknown-linux-gnu
if curl -fsSL -o rs-guard-x86_64-unknown-linux-gnu.sha256 \
https://github.com/nebulaideas/rs-guard/releases/download/v1.0.0/rs-guard-x86_64-unknown-linux-gnu.sha256; then
sha256sum -c rs-guard-x86_64-unknown-linux-gnu.sha256
else
echo "::warning::No .sha256 file published for this release; skipping integrity check."
fi
chmod +x rs-guard-x86_64-unknown-linux-gnu
mv rs-guard-x86_64-unknown-linux-gnu rs-guard
- name: AI Code Review
run: ./rs-guard --prompt-file .github/review-prompt.md
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO_FULL_NAME: ${{ github.repository }}