codeflash-internal/.github/workflows/claude.yml
Workflow config file is invalid. Please check your config file: yaml: line 59: could not find expected ':'
Kevin Turcios 3ac7eb5982
improve continuous review (#2271)
- Re-enable synchronize trigger for automatic re-reviews on each push
- Add logic to detect and resolve fixed issues automatically
- Focus reviews only on critical bugs, security, breaking changes, test
failures
- Limit to 5-7 high-signal comments per review
- Review only changed files on re-reviews (incremental approach)
- Add detailed PR review guidelines in CLAUDE.md
- Increase fetch-depth to 2 for commit comparison

This reduces review noise while maintaining continuous quality checks.

# Pull Request Checklist

## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets

## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes

## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code

## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---

## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->
2026-01-23 01:03:12 -05:00

80 lines
3.4 KiB
YAML

name: Claude Code
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: read
id-token: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
use_foundry: "true"
use_sticky_comment: ${{ github.event_name == 'pull_request' }}
prompt: |
${{ github.event_name == 'pull_request' && format('
REPO: {0}
PR NUMBER: {1}
EVENT: {2}
{3}
IMPORTANT:
- First check existing review comments using `gh api repos/{0}/pulls/{1}/comments`. For each existing comment, check if the issue still exists in the current code.
- If an issue is fixed, use `gh api --method PATCH repos/{0}/pulls/comments/COMMENT_ID -f body="✅ Fixed in latest commit"` to resolve it.
- Only create NEW inline comments for HIGH-PRIORITY issues found in changed files.
- Limit to 5-7 NEW comments maximum per review.
- Use CLAUDE.md for project-specific guidance.
- Use `gh pr comment` for summary-level feedback.
- Use `mcp__github_inline_comment__create_inline_comment` sparingly for critical code issues only.
', github.repository, github.event.pull_request.number, github.event.action, github.event.action == 'synchronize' && '
This is a RE-REVIEW after new commits.
1. First, get the list of changed files in this latest push using `gh pr diff`
2. Review ONLY the changed files focusing on:
- Critical bugs or logic errors
- Security vulnerabilities
- Breaking API changes
- Test failures (methods with typos that won''t run)
3. Check ALL existing review comments and resolve ones that are now fixed' || '
This is the INITIAL REVIEW.
Review this PR focusing ONLY on:
1. Critical bugs or logic errors
2. Security vulnerabilities
3. Breaking API changes
4. Test failures (methods with typos that won''t run)') || '' }}
claude_args: ${{ github.event_name == 'pull_request' && '--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh issue view:*),Bash(gh issue list:*),Read,Glob,Grep"' || '' }}
additional_permissions: |
actions: read
env:
ANTHROPIC_FOUNDRY_API_KEY: ${{ secrets.ANTHROPIC_FOUNDRY_API_KEY }}
ANTHROPIC_FOUNDRY_BASE_URL: ${{ secrets.ANTHROPIC_FOUNDRY_BASE_URL }}