From 7e135a53ec8a2133015202e67982b7b41e879c5b Mon Sep 17 00:00:00 2001 From: kolesnykovyurii Date: Wed, 15 Apr 2026 15:33:53 +0300 Subject: [PATCH] ci: add AI code review workflow --- .github/workflows/ai-review.yml | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/ai-review.yml diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml new file mode 100644 index 00000000..9ab3d4b4 --- /dev/null +++ b/.github/workflows/ai-review.yml @@ -0,0 +1,37 @@ +name: AI Code Review + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + ai-review: + name: AI Code Review (Local LLM) + runs-on: [self-hosted, ai-review] + timeout-minutes: 30 + concurrency: + group: ai-review-pr-${{ github.event.pull_request.number }} + cancel-in-progress: true + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run AI Code Review + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OLLAMA_HOST: http://127.0.0.1:11434 + OLLAMA_MODEL: qwen2.5-coder:32b-instruct-q4_K_M + run: | + cd /opt/ai-review + python3 main.py --pr-number ${{ github.event.pull_request.number }} --repo ${{ github.repository }} + + - name: Cost report + if: always() + run: | + cd /opt/ai-review + python3 main.py --pr-number 0 --repo x/x --report 2>/dev/null || python3 -c " + import sys; sys.path.insert(0,"."); + from cost_tracker import print_cost_report; + print_cost_report() + "