-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.46 KB
/
Copy pathai-code-review.yml
File metadata and controls
55 lines (46 loc) · 1.46 KB
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
name: AI Code Review
on:
pull_request:
branches: [main, developer]
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
issues: write
models: read
jobs:
ai-review:
runs-on: ubuntu-latest
# Não executar em PRs criados por bots para evitar loops
if: github.actor != 'github-actions[bot]'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Necessário para obter o histórico completo do PR
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install dependencies
run: pnpm install openai @octokit/rest
- name: Run AI Code Review
env:
GH_MODELS_TOKEN: ${{ secrets.GH_MODELS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
run: |
echo "🚀 Iniciando AI Code Review..."
echo "PR Number: ${{ github.event.number }}"
echo "Repository: ${{ github.repository }}"
node .github/scripts/ai-review.js
- name: Review Summary
if: always()
run: |
echo "✅ AI Code Review processado"
echo "📊 Verifique os comentários no Pull Request para ver o resultado"