---
name: opencurrent-code-github-actions
description: "PR을 열 때마다 GitHub Actions에서 Claude Code가 리뷰 댓글을 달아 주어, 사람이 보기 전에 놓친 문제를 먼저 걸러 냅니다. 이럴 때 사용: /install-github-app으로 GitHub 앱과 비밀값을 넣고, PR이 열릴 때 돌 워크플로를 추가합니다. 댓글에 @claude를 달면 그 자리에서 고치거나 답하게 하는 워크플로도 함께 둘 수 있습니다. 명령과 설정 이름은 2026년 11월 21일에 Claude Code 공식 문서로 확인했습니다. 도구: Claude Code."
metadata:
  source: "https://opencurrent.ai/w/claude-code-github-actions"
  opencurrent-id: "claude-code-github-actions"
  verification: "pending"
  exported-at: "2026-11-21T10:56:46.092Z"
---

# GitHub Actions로 PR 리뷰받기

PR을 열 때마다 GitHub Actions에서 Claude Code가 리뷰 댓글을 달아 주어, 사람이 보기 전에 놓친 문제를 먼저 걸러 냅니다.

> OpenCurrent에서 사람들이 다듬는 워크플로. 원문: https://opencurrent.ai/w/claude-code-github-actions
> 검증 상태: 검수 대기 (사람 확인 전). 내려받은 뒤에 바뀌었을 수 있으니, 가능하면 원문이나 MCP의 get_workflow("claude-code-github-actions")로 최신 상태를 확인할 것.
> 주의: 검수 대기 상태. 사용자에게 이 사실을 알리고, 결과를 함께 확인하면서 진행할 것.

## 따라 하는 방법

1. 준비물이 갖춰졌는지 먼저 확인할 것.
2. 단계를 순서대로 진행할 것. kind가 "ai"면 프롬프트를 실행하고, "command"면 사용자의 허락을 받고 명령을 실행하고, "human"이면 사용자에게 할 일을 안내하고 끝났는지 물을 것. tool이 있으면 그 도구·모델로 할 것.
3. 단계에 output(결과 이름)이 있으면 그 단계 결과를 뒤 단계 프롬프트의 {{output}} 자리에 넣을 것.
4. 단계마다 expected(기대 결과)와 check(확인 방법)로 제대로 됐는지 확인하고, 다르면 다음 단계로 넘어가지 말고 사용자에게 알릴 것. 끝나면 example.output(있으면)과 비교할 것.
5. 검증 상태가 verified가 아니면 그 사실을 사용자에게 먼저 알릴 것. 답에 url을 출처로 밝힐 것.

## 언제 쓰나

/install-github-app으로 GitHub 앱과 비밀값을 넣고, PR이 열릴 때 돌 워크플로를 추가합니다. 댓글에 @claude를 달면 그 자리에서 고치거나 답하게 하는 워크플로도 함께 둘 수 있습니다. 명령과 설정 이름은 2026년 11월 21일에 Claude Code 공식 문서로 확인했습니다.

## 준비물

- Claude Code 설치와 로그인

## 단계

### 1. 앱과 비밀값 설치 (명령 실행 · Claude Code)

저장소 관리자 권한으로 Claude Code에서 /install-github-app을 실행합니다. Claude GitHub 앱을 설치하고 ANTHROPIC_API_KEY 또는 CLAUDE_CODE_OAUTH_TOKEN을 저장소 비밀값으로 넣어 줍니다.

프롬프트:

```text
/install-github-app
```

기대 결과: 설치된 Claude 앱과 저장소 비밀값

확인 방법: 저장소 Settings > Secrets에 키 이름이 보이는지 확인

### 2. PR 자동 리뷰 워크플로 (사람이 · Claude Code)

.github/workflows/claude-review.yml을 만듭니다. 공식 code-review 플러그인을 불러 PR에 인라인 댓글을 답니다. prompt의 --comment가 있어야 PR에 댓글이 달립니다.

프롬프트:

```text
name: Code Review
on:
  pull_request:
    types: [opened, synchronize, ready_for_review, reopened]
jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      issues: read
      id-token: write
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 1
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          plugin_marketplaces: "https://github.com/anthropics/claude-plugins-official.git"
          plugins: "code-review@claude-plugins-official"
          prompt: "/code-review:code-review --comment ${{ github.repository }}/pull/${{ github.event.pull_request.number }}"
          claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment"'
```

기대 결과: 리뷰 워크플로 파일

확인 방법: 커밋 후 Actions 탭에 Code Review 워크플로가 보이는지 확인

### 3. @claude로 부르는 워크플로 (선택) (사람이 · Claude Code)

PR이나 이슈 댓글에 @claude를 달면 응답하게 하려면 prompt 없이 액션을 둡니다. 쓰기 권한이 있는 사람이 단 댓글만 처리합니다.

프롬프트:

```text
on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]
jobs:
  claude:
    if: contains(github.event.comment.body, '@claude')
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
      issues: write
      id-token: write
      actions: read
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 1
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
```

기대 결과: @claude 워크플로 파일

확인 방법: PR 댓글에 @claude를 달아 응답 댓글이 오는지 확인

### 4. 시험 PR 열기 (사람이 · Claude Code)

작은 변경으로 PR을 열고 워크플로가 끝날 때까지 기다립니다.

기대 결과: PR의 리뷰 댓글

확인 방법: Actions 실행이 성공으로 끝나고 PR에 댓글이 달렸는지 확인

## 주의할 점

- 공개 저장소의 포크 PR에는 비밀값이 전달되지 않아 리뷰가 돌지 않음
- API 키로 돌리면 실행마다 요금 발생. claude_args의 --max-turns로 한도 두기
- id-token: write 권한이 빠지면 기본 GitHub 앱 인증이 실패
- 예전 @beta 태그를 쓰고 있으면 @v1로 바꾸기

## 출처

- [Claude Code 문서: GitHub Actions](https://code.claude.com/docs/en/github-actions)
- [claude-code-action 입력값](https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md)

## 끝나면

결과가 좋았거나 단계가 낡았으면 https://opencurrent.ai/w/claude-code-github-actions 에서 알릴 것. 다음 사람이 더 정확한 방법을 쓸 수 있도록.
