İçeriğe geç

Proje: Kod İnceleme Otomasyonu

GitHub Actions + Claude'la PR review otomasyonu: diff parse, kural setine göre yorum, severity etiketi.

Şükrü Yusuf KAYA
12 dakikalık okuma
İleri
GitHub PR'a Claude review yorumu

Pipeline

PR opened → Action triggers → Fetch diff → Claude review → ├─ post inline comments └─ post summary + severity (block / non-block)
Block severity = CI red, non-block = bilgilendirici.
yaml
# .github/workflows/claude-review.yml
name: claude-review
on:
pull_request:
types: [opened, synchronize]
 
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Get diff
run: git diff origin/main..HEAD > /tmp/diff.txt
- name: Run Claude review
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: python scripts/claude_review.py /tmp/diff.txt
- name: Post comments
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const review = JSON.parse(fs.readFileSync('/tmp/review.json', 'utf-8'));
for (const c of review.blocking_issues) {
await github.rest.pulls.createReviewComment({
...context.repo, pull_number: context.issue.number,
body: c.comment, commit_id: process.env.GITHUB_SHA,
path: c.file, line: c.line,
});
}
if (review.blocking_issues.length > 0) {
core.setFailed('Blocking issues found');
}
GitHub Actions iş akışı — Claude review entegrasyonu.
Boşluk doldur · text
PR review pipeline'ında diff _____ aşılırsa parçala. Yorumlar _____ severity ile etiketlenir. Yanlış pozitifler _____ setine eklenir.

Sık Sorulan Sorular

Hayır. Claude review insan review'ı **destekler**, yer almaz. Bazı ekipler 'Claude review tüm kuralları geçti, insan onayı bekleniyor' aşaması koyar.

Yorumlar & Soru-Cevap

(0)
Yorum yazmak için giriş yap.
Yorumlar yükleniyor...

İlgili İçerikler