This PR transforms DirectHW into a modern, Apple Silicon-ready framework with robust CI/CD support and comprehensive documentation! 🎉 #17
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: write | |
| pull-requests: write | |
| issues: write | |
| id-token: write | |
| jobs: | |
| claude-review: | |
| # Only run on PRs from the same repository (not forks) to avoid permission issues | |
| # For fork PRs, Claude reviews would need to be in the upstream repo or use PATs | |
| if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository | |
| 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.GITHUB_TOKEN }} | |
| prompt: | | |
| REPO: ${{ github.repository }} | |
| PR NUMBER: ${{ github.event.pull_request.number }} | |
| 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. | |
| Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR. | |
| # 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" | |
| else | |
| echo "⚠️ Claude code review encountered issues" | |
| exit 1 | |
| fi |