feat: global reusable workflows (workflow_call) + thin caller template
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
36
README.md
36
README.md
@@ -24,20 +24,40 @@ scripts/
|
||||
context.py Gitea-Actions-Event-Kontext (GITHUB_*-Vars)
|
||||
ai_review.py Feature A
|
||||
ai_explain.py Features B & C
|
||||
workflows/ Beispiel-Workflows zum Kopieren in Ziel-Repos
|
||||
.gitea/workflows/
|
||||
reusable-security.yml on: workflow_call — zentraler Security-Scan
|
||||
reusable-ai-review.yml on: workflow_call — zentraler PR-Review
|
||||
workflows/
|
||||
caller.example.yml der EINE 12-Zeiler fürs Ziel-Repo (empfohlen)
|
||||
*.example.yml standalone-Workflows (Alternative: kopieren)
|
||||
```
|
||||
|
||||
Keine Abhängigkeiten — reine Python-Standardbibliothek, kein `pip install`.
|
||||
|
||||
## In ein Repo einbauen
|
||||
|
||||
1. Beispiel aus `workflows/` nach `.gitea/workflows/` im Ziel-Repo kopieren.
|
||||
2. Im Repo (oder org-weit) die **Actions-Unit** aktivieren.
|
||||
3. **Actions-Secret** `ANTHROPIC_API_KEY` setzen. Kommentiert wird per Auto-Token
|
||||
(`${{ github.token }}`); reichen dessen Rechte nicht, ein `GITEA_BOT_TOKEN`
|
||||
(PAT mit `write:issue`) als Secret hinterlegen.
|
||||
4. Für „hart blockieren": in der Branch-Protection den `Security`-Check als
|
||||
*required* markieren.
|
||||
### Empfohlen: globaler Aufruf (reusable workflow)
|
||||
|
||||
Nur **eine** Datei ins Ziel-Repo: `workflows/caller.example.yml` →
|
||||
`.gitea/workflows/ci-ai.yml`. Sie ruft die zentrale Logik aus diesem Repo auf
|
||||
(`uses: user2595/ci-ai/.gitea/workflows/reusable-*.yml@main` + `secrets: inherit`).
|
||||
Logik-Updates passieren **einmal hier**, alle Repos ziehen automatisch nach.
|
||||
|
||||
Einmalig zentral einzurichten:
|
||||
|
||||
1. Runner **instanzweit** registrieren (Admin → Actions → Runners), Label `eulernest`
|
||||
— sonst haben Repos außerhalb der org keinen Runner.
|
||||
2. **Anonymen Clone für public Repos** erlauben (`REQUIRE_SIGNIN_VIEW=false`) — der Job
|
||||
klont `ci-ai` für die Skripte.
|
||||
3. `ANTHROPIC_API_KEY` als **Org-/Instanz-Actions-Secret** (KI-Schritte; ohne ihn laufen
|
||||
die Scans normal, die KI-Teile überspringen sich sauber).
|
||||
4. Für „hart blockieren": `security`-Check in der Branch-Protection als *required*.
|
||||
|
||||
### Alternative: standalone (kopieren)
|
||||
|
||||
`workflows/ai-review.example.yml` + `workflows/security.example.yml` direkt nach
|
||||
`.gitea/workflows/` kopieren. Enthält die volle Logik (klont die Skripte selbst) —
|
||||
mehr Copy-Paste, aber unabhängig von reusable-workflow-Support.
|
||||
|
||||
## Umstieg auf den Jetson (später)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user