ci-ai: KI-Schicht für die Gitea-CI (PR-Review, Security-Erklärung, CI-Failure-Analyse)
Provider-agnostische LLM-Anbindung (Anthropic jetzt, Jetson/Ollama später per Env-Var umschaltbar). Stdlib-only Skripte + Beispiel-Workflows. GitLab-Duo-Parität für self-hosted Gitea + act_runner. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
40
workflows/ai-review.example.yml
Normal file
40
workflows/ai-review.example.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
# Feature A — KI-PR-Review + Summary.
|
||||
# In ein Ziel-Repo kopieren nach: .gitea/workflows/ai-review.yml
|
||||
#
|
||||
# Nutzt KEINE JS-Actions (kein node nötig): schlankes python-Image, ci-ai wird
|
||||
# manuell geklont. GITHUB_REPOSITORY / GITHUB_EVENT_PATH setzt Gitea automatisch.
|
||||
name: AI PR Review
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
review:
|
||||
runs-on: eulernest
|
||||
container: python:3.12-slim
|
||||
steps:
|
||||
- name: Tooling (git)
|
||||
run: apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates
|
||||
|
||||
- name: ci-ai-Skripte holen
|
||||
run: git clone --depth 1 https://git.eulernest.eu/user2595/ci-ai.git /opt/ci-ai
|
||||
|
||||
- name: KI-Review
|
||||
env:
|
||||
AI_PROVIDER: anthropic
|
||||
AI_MODEL: claude-3-5-haiku-latest
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
# Kommentieren: Actions-Auto-Token. Reicht dessen Schreibrecht nicht,
|
||||
# stattdessen GITEA_BOT_TOKEN (PAT) als Repo-/Org-Secret setzen.
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
GITEA_API: https://git.eulernest.eu/api/v1
|
||||
run: python /opt/ci-ai/scripts/ai_review.py
|
||||
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
# Späterer Umstieg auf den Jetson (lokales Ollama) — NUR diese env-Werte ändern,
|
||||
# kein Code-Change:
|
||||
# AI_PROVIDER: ollama
|
||||
# AI_MODEL: qwen-light
|
||||
# AI_BASE_URL: http://192.168.178.20:11434/v1
|
||||
# JETSON_API_KEY: ${{ secrets.JETSON_API_KEY }}
|
||||
Reference in New Issue
Block a user