모든 PR을 리뷰하는 GitHub Action
고급
가치가 큰 고전적인 자동화: Claude가 모든 풀 리퀘스트를 리뷰하고 그 발견 사항을 코멘트로 게시하게 하는 것 — CI에서 헤드리스로 실행합니다. 안전하게 유지해 주는 가드레일과 함께, 그 형태는 다음과 같습니다.
무엇을 하는가
각 PR마다: diff를 체크아웃하고, Claude에게 버그/엣지 케이스/컨벤션 문제를 리뷰하도록 요청한 뒤, 코멘트를 게시합니다. 결정은 여전히 사람이 하며, Claude는 빠른 1차 검토만 제공합니다.
워크플로 (개략)
name: Claude PR review
on: pull_request
permissions:
contents: read
pull-requests: write # to comment — NOT write to code
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Review the diff
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
git diff origin/${{ github.base_ref }}...HEAD > /tmp/diff.patch
claude -p "Review this diff for correctness bugs, missing edge cases, and
security issues. Report ONLY high-confidence findings as a Markdown
checklist with file:line. Diff:" < /tmp/diff.patch > /tmp/review.md
# then post /tmp/review.md as a PR comment (e.g. with the gh CLI or an action)
(정확한 헤드리스 호출 방법은 다를 수 있습니다 — 문서를 참고하세요. 원칙은 이렇습니다: diff를 입력하고, Markdown을 캡처하고, 게시한다.)
가드레일 (자율 실행 강화하기를 읽으세요)
CI에서의 최소 권한
시끄럽지 않고 유용하게 만들기
- 확신도 높은 발견 사항만 요청하세요 — 사소한 지적이 잔뜩 쌓이면 무시됩니다.
- 1차 검토로 유지하고, 머지 결정은 사람이 내리게 하세요.