Skip to main content
EVOKORE// WORKFLOWS / claude-code-doc-review.yml
ComposioHQ/composioworkflow · 77 lines

workflows/claude-code-doc-review.yml

CI / automation

View on GitHub →
# REFERENCE-ONLY: GitHub Actions secrets referenced below are illustrative.
# Do not inject real credentials. See your CI/CD provider for proper secret management.
name: Claude Docs Review

on:
  pull_request:
    types: [ opened, synchronize ]
    # Run on docs changes (content, components, styles)
    paths:
    - "docs/content/**/*.mdx"
    - "docs/components/**/*.tsx"
    - "docs/app/**/*.tsx"
    - "docs/app/**/*.css"
jobs:
  claude-review:
    # Optional: Filter by PR author
    # if: |
    #   github.event.pull_request.user.login == 'external-contributor' ||
    #   github.event.pull_request.user.login == 'new-developer' ||
    #   github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'

    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      issues: read
      id-token: write

    steps:
    - name: Checkout repository
      uses: actions/checkout@v6
      with:
        fetch-depth: 1

    - name: Run Claude Code Review
      id: claude-review
      uses: anthropics/claude-code-action@v1
      with:
        anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
        track_progress: true # Forces tag mode with tracking comments

        # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
        # model: "claude-opus-4-20250514"

        # Review instructions in docs/.claude/agents/docs-reviewer.md
        prompt: |
          Review this PR using the guidelines in docs/.claude/agents/docs-reviewer.md

          1. Read docs/.claude/agents/docs-reviewer.md for full review criteria
          2. Run `git diff origin/${{ github.event.pull_request.base.ref }}...HEAD` to see changes
          3. Apply the review checklist to changed files
          4. If issues: Comment with specific fixes. If none: Approve with "Looks good"
        # Optional: Customize review based on file types
        # direct_prompt: |
        #   Review this PR focusing on:
        #   - For TypeScript files: Type safety and proper interface usage
        #   - For API endpoints: Security, input validation, and error handling
        #   - For React components: Performance, accessibility, and best practices
        #   - For tests: Coverage, edge cases, and test quality

        # Optional: Different prompts for different authors
        # direct_prompt: |
        #   ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' && 
        #   'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
        #   'Please provide a thorough code review focusing on our coding standards and best practices.' }}

        # https://code.claude.com/docs/en/cli-reference#cli-flags
        # -- model: "claude-opus-4-20250514"
        claude_args: |
          --allowedTools "Bash(*)"

        # Optional: Skip review for certain conditions
        # if: |
        #   !contains(github.event.pull_request.title, '[skip-review]') &&
        #   !contains(github.event.pull_request.title, '[WIP]')