CC-301g · Module 1

GitHub Actions Configuration

4 min read

The Claude Code GitHub Action (anthropics/claude-code-action) is a packaged integration that runs Claude Code in your CI environment. Configuration is a YAML workflow file that specifies triggers, permissions, and inputs. The minimum viable configuration needs three things: a trigger (when the action fires), an API key (stored as a GitHub secret), and permissions (what the action can do).

The trigger configuration determines the review cadence. The pull_request trigger reviews every PR automatically — high coverage, higher API cost. The issue_comment trigger reviews on demand when a developer tags @claude — lower coverage, lower cost, more intentional. The workflow_dispatch trigger lets you manually trigger a review from the GitHub UI. Most teams start with issue_comment (on-demand) and expand to pull_request (automatic) once they have tuned the review criteria and confirmed the value.

name: Claude Review
on:
  issue_comment:
    types: [created]
  pull_request:
    types: [opened, synchronize]

permissions:
  contents: read
  pull-requests: write
  issues: read

jobs:
  review:
    if: |
      (github.event_name == 'pull_request') ||
      (github.event_name == 'issue_comment' &&
       contains(github.event.comment.body, '@claude'))
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          timeout_minutes: 5