# Example GitHub Actions workflow
# Copy this in your repo at: .github/workflows/pr-review.yml

name: Abacus PR Review

on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  review:
    runs-on: ubuntu-latest

    # Uncomment to only run on PRs from the same repository (not forks)
    # if: github.event.pull_request.head.repo.full_name == github.repository

    permissions:
      contents: read
      pull-requests: write
      issues: write

    steps:
      - name: Run Abacus PR Review
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          npx abacus-pr-review \
            ${{ github.repository_owner }} \
            ${{ github.event.repository.name }} \
            ${{ github.event.pull_request.number }}
