name: Claude Code Review
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
# Claude review runs only after tests pass
claude-review:
if: ${{ !github.event.pull_request.draft }} # Skip draft PRs
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code Review
uses: anthropics/claude-code-action@beta
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
timeout_minutes: "60"
direct_prompt: |
You are a senior TypeScript/Node.js engineer reviewing this MCP (Model Context Protocol) server for Zebrunner integration.
**Context:**
- This is a TypeScript MCP server that integrates with Zebrunner TCM and Reporting APIs
- It provides tools for test case management, failure analysis, video/screenshot analysis
- Security is critical - we handle authentication tokens and file system access
**Review Focus:**
1. **Security**: Validate input sanitization, path traversal prevention, credential handling, API security
2. **TypeScript Quality**: Check types, interfaces, generics, async/await patterns, error handling
3. **API Integration**: Verify proper error handling for Zebrunner API calls, rate limiting, retry logic
4. **Code Quality**: Assess maintainability, readability, performance, edge cases
5. **Business Logic**: Identify edge cases not covered by tests, potential race conditions
6. **MCP Compliance**: Ensure tool schemas match implementation, proper resource handling
**Exclude from review:**
- Files in `dist/` (compiled output)
- Files in `node_modules/` (dependencies)
- Files in `tests/` (test files)
**Output:**
- Summarize changes succinctly
- Highlight critical security issues (if any)
- Identify bugs or edge cases
- Suggest specific improvements with priority (HIGH/MEDIUM/LOW)
- Focus on actionable feedback
Provide a detailed but concise review with clear recommendations.
- name: Review Summary
run: |
echo "✅ Claude review posted for PR: ${{ github.event.pull_request.html_url }}"