Files
flask-2fa-auth/.github/workflows/ai-code-review.yml
Hamit Şimşek 95c2fe79b1 Add AI-powered code review GitHub Action
Introduces a workflow that uses an OpenAI model to analyze code changes on the development branch. If an issue is detected in the diff, the script automatically creates a GitHub issue with relevant details, labels, and assignees.
2025-10-31 23:39:37 +03:00

41 lines
939 B
YAML

name: AI Code Review
on:
push:
branches:
- development
permissions:
contents: read
issues: write
env:
DEFAULT_ASSIGNEE: "lightningcell"
DEFAULT_LABELS: "ai-review"
MAX_DIFF_CHARS: "20000"
OPENAI_MODEL: "gpt-4o-mini"
jobs:
ai-review:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Run AI review script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DEFAULT_ASSIGNEE: ${{ env.DEFAULT_ASSIGNEE }}
DEFAULT_LABELS: ${{ env.DEFAULT_LABELS }}
MAX_DIFF_CHARS: ${{ env.MAX_DIFF_CHARS }}
OPENAI_MODEL: ${{ env.OPENAI_MODEL }}
run: |
node .github/scripts/ai-review.js