BACK TO TEMPLATES
workflowsany

Automated AI Code Reviewer GitHub Action Workflow

GitHub Actions YAML workflow for running automated AI PR reviews on pull request open and update events.

When to use this

Add this workflow file to .github/workflows/ to trigger automated AI code reviews on every pull request.

The template

name: AI Code Reviewer

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Run AI Code Review
        uses: anthropic/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          prompt: "Perform a thorough code review on the pull request git diff. Flag bugs, security risks, and performance regressions."

How to use

Save to .github/workflows/ai-code-review.yml and add ANTHROPIC_API_KEY to repository secrets.

Last verified 2026-07-26