This PR transforms DirectHW into a modern, Apple Silicon-ready framework with robust CI/CD support and comprehensive documentation! 🎉 #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Claude Code Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| # Optional: Only run on specific file changes | |
| # paths: | |
| # - "src/**/*.ts" | |
| # - "src/**/*.tsx" | |
| # - "src/**/*.js" | |
| # - "src/**/*.jsx" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| claude-review: | |
| # Run for all PRs including forks - use PAT for fork PR commenting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Debug PR info | |
| run: | | |
| echo "Event name: ${{ github.event_name }}" | |
| echo "PR number: ${{ github.event.pull_request.number }}" | |
| echo "PR head repo: ${{ github.event.pull_request.head.repo.full_name }}" | |
| echo "Base repo: ${{ github.repository }}" | |
| echo "Is fork: ${{ github.event.pull_request.head.repo.full_name != github.repository }}" | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| # For pull_request, check out the PR head | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: Run Claude Code Review | |
| id: claude-review | |
| uses: anthropics/claude-code-action@v1 | |
| with: | |
| anthropic_api_key: ${{ secrets.CLAUDE_API_KEY }} | |
| github_token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | |
| prompt: | | |
| REPO: ${{ github.event.pull_request.head.repo.full_name }} | |
| PR NUMBER: ${{ github.event.pull_request.number }} | |
| BASE REPO: ${{ github.repository }} | |
| Please review this pull request and provide feedback on: | |
| - Code quality and best practices | |
| - Potential bugs or issues | |
| - Performance considerations | |
| - Security concerns | |
| - Test coverage | |
| Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback. | |
| IMPORTANT: When commenting on the PR, comment on the head repository (fork): | |
| - Use \`gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.event.pull_request.head.repo.full_name }}\` | |
| This will comment on the fork PR where we have write permissions. | |
| # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md | |
| # or https://code.claude.com/docs/en/cli-reference for available options | |
| claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' | |
| - name: Handle Review Results | |
| if: always() | |
| run: | | |
| if [ "${{ steps.claude-review.outcome }}" == "success" ]; then | |
| echo "✅ Claude code review completed successfully" | |
| elif [ "${{ steps.claude-review.outcome }}" == "skipped" ]; then | |
| echo "ℹ️ Claude code review skipped" | |
| else | |
| echo "⚠️ Claude code review encountered issues" | |
| echo "This may be due to insufficient permissions for fork PRs" | |
| echo "For fork PRs, consider adding a PAT secret to enable commenting" | |
| exit 1 | |
| fi |