feat: create AI-REVIEW-README.md and update Readme.md
#6
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: AI Code Review | |
| on: | |
| pull_request: | |
| branches: [main, developer] | |
| types: [opened, synchronize, reopened] | |
| push: | |
| branches: [main, developer] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| models: read | |
| jobs: | |
| ai-review: | |
| runs-on: ubuntu-latest | |
| # Não executar em PRs criados por bots para evitar loops | |
| if: github.actor != 'github-actions[bot]' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Necessário para obter o histórico completo do PR | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: pnpm install openai @octokit/rest | |
| - name: Run AI Code Review | |
| env: | |
| GH_MODELS_TOKEN: ${{ secrets.GH_MODELS_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| GITHUB_EVENT_PATH: ${{ github.event_path }} | |
| run: | | |
| echo "🚀 Iniciando AI Code Review..." | |
| echo "PR Number: ${{ github.event.number }}" | |
| echo "Repository: ${{ github.repository }}" | |
| node .github/scripts/ai-review.js | |
| - name: Review Summary | |
| if: always() | |
| run: | | |
| echo "✅ AI Code Review processado" | |
| echo "📊 Verifique os comentários no Pull Request para ver o resultado" |