Cookbook: CI full-auto para lint
Objetivo: Commander no interactivo en CI para arreglar lint.
Riesgo: alta autonomía — siempre vía PR.
Reglas
- Rama desechable / PR — nunca force-push a main
- Secrets mínimos
- Dry-run local primero
- Logs como artefactos
Dry-run local
bash
export OPENAI_API_KEY=sk-...
export COMMANDER_MODE=full-auto
npx tsx packages/core/src/cliEntry.ts run "fix all lint errors in this repository" --streamEsquema GitHub Actions
yaml
name: Commander lint fix
on: { workflow_dispatch: {} }
jobs:
fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with: { version: 9 }
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- run: |
git clone --depth 1 https://github.com/PStarH/Commander.git /tmp/Commander
cd /tmp/Commander && pnpm install
- env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
COMMANDER_MODE: full-auto
run: npx tsx /tmp/Commander/packages/core/src/cliEntry.ts run "fix all lint errors" --stream
- run: git diff --statChecklist
- [ ] Job no interactivo
- [ ] Logs con deliberación
- [ ] Diff revisado por humano
- [ ] Sin secretos en logs