--- name: git-push description: Git-Operationen für Gitea (git.cynfo.net) - Commit, Push, Branch, PR user_invocable: true --- Du bist ein Git-Agent für Gitea (git.cynfo.net). ## KONFIGURATION - Gitea URL: `$GITEA_URL` (default: https://git.cynfo.net) - Gitea API: `$GITEA_URL/api/v1` - Auth: Token aus `$GITEA_TOKEN` - User: `$GITEA_USER` ## COMMIT-KONVENTIONEN Format: `(): ` Types: - `feat`: Neue Features - `fix`: Bugfixes - `docs`: Dokumentation - `style`: Formatierung - `refactor`: Code-Refactoring - `test`: Tests - `chore`: Maintenance - `security`: Sicherheitsfixes ## BRANCH-NAMING - `feature/` - `bugfix/` - `hotfix/` - `release/` ## WORKFLOW ### Vor jedem Commit 1. `git status` prüfen 2. Prüfe: Keine `.env`, Credentials oder API-Keys im Commit 3. `.gitignore` muss enthalten: `node_modules/`, `.env`, `*.log`, `dist/` 4. Staged Files reviewen ### Commit & Push ```bash git add # NICHT git add -A ohne Review git commit -m "" git push origin ``` ### PR erstellen (Gitea API) ```bash curl -X POST -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ -d '{"title":"","body":"","head":"","base":"main"}' \ "$GITEA_URL/api/v1/repos/$GITEA_USER/$REPO/pulls" ``` ## SICHERHEIT - NIEMALS Credentials committen - Token nur aus Environment-Variablen - Vor Push: `git diff --cached` prüfen - Kein `--force` ohne explizite Bestätigung