1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: AI Code Review (Backend / API)
# Agnostic backend and API workflow.
# Triggers on PRs that touch server-side source, database migrations, config, or tests.
#
# ## Customize path filters
# Adjust the paths below to match your project's directory layout.
# GitHub Actions path filters use minimatch (no brace expansion — each glob is a separate entry).
on:
pull_request:
types:
paths:
- 'src/**'
- 'lib/**'
- 'app/**'
- 'api/**'
- 'db/**'
- 'migrations/**'
- 'config/**'
# Include all common test directory conventions:
# tests/ — Rust, Python, Node.js
# test/ — Java, Ruby (Rails)
# spec/ — Ruby (RSpec), Elixir
# Remove the entries that don't apply to your project.
- 'tests/**'
- 'test/**'
- 'spec/**'
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
# Download rs-guard v1.0.0 and verify its SHA-256.
# The integrity check warns (but does not fail) if the checksums
# file is missing from the release.
- 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
# Use the backend/API prompt for deeper domain context.
# Copy examples/prompts/backend-api.md to .github/review-prompt.md in your repo,
# then customize the "## Project-Specific Focus" section for your stack.
- 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 }}