30 lines
760 B
YAML
30 lines
760 B
YAML
name: AI PR Review
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
ai-review:
|
|
name: AI PR Review
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get PR diff
|
|
run: git diff origin/${{ github.base_ref }}...HEAD > /tmp/pr.diff
|
|
|
|
- name: Run AI review
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
AI_REVIEW_API_KEY: ${{ secrets.AI_REVIEW_API_KEY }}
|
|
AI_REVIEW_MODEL: ${{ vars.AI_REVIEW_MODEL || 'openrouter/openai/gpt-4o-mini' }}
|
|
PR_NUMBER: ${{ github.event.number }}
|
|
run: python3 .github/scripts/ai_review.py /tmp/pr.diff
|