rs-guard 1.0.0

AI-powered code review CLI for GitHub PRs
Documentation
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: [opened, synchronize, reopened]
    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 }}