diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml
index 0da97e8..f235589 100644
--- a/.github/workflows/action-test.yml
+++ b/.github/workflows/action-test.yml
@@ -74,6 +74,21 @@ jobs:
out: out/real-dark.svg
theme: dark
+ # Un usuario que no existe es un error permanente: falla aunque
+ # keep-on-error esté activada y haya un SVG previo, que queda intacto.
+ - name: Preparar un SVG previo para el usuario inexistente
+ env:
+ FIXTURE_PATH: ${{ steps.fixture.outputs.path }}
+ run: cp "$FIXTURE_PATH" out/nouser.svg
+
+ - name: Un usuario inexistente falla con un error claro
+ id: nouser
+ continue-on-error: true
+ uses: ./
+ with:
+ user: commitling-usuario-que-no-existe-0
+ out: out/nouser.svg
+
# keep-on-error (activada por defecto) solo conserva el SVG ante fallos
# transitorios (red, 5xx, límite de peticiones), que cubren los tests de
# la CLI. Un 401 (token inválido) es permanente: debe fallar aunque haya
@@ -120,6 +135,7 @@ jobs:
INVALID_OUTCOME: ${{ steps.invalid.outcome }}
UNAUTHORIZED_OUTCOME: ${{ steps.unauthorized.outcome }}
BADKEEP_OUTCOME: ${{ steps.badkeep.outcome }}
+ NOUSER_OUTCOME: ${{ steps.nouser.outcome }}
OWNER: ${{ github.repository_owner }}
run: |
set -euo pipefail
@@ -130,6 +146,8 @@ jobs:
test "$UNAUTHORIZED_OUTCOME" = failure || { echo 'un 401 debería fallar aunque haya SVG previo'; exit 1; }
test "$BADKEEP_OUTCOME" = failure || { echo 'keep-on-error: quizas debería fallar'; exit 1; }
test ! -e out/badkeep.svg
+ test "$NOUSER_OUTCOME" = failure || { echo 'un usuario inexistente debería fallar'; exit 1; }
+ cmp out/nouser.svg "$FIXTURE_PATH" || { echo 'el SVG previo del usuario inexistente cambió'; exit 1; }
cmp out/keep.svg "$FIXTURE_PATH" || { echo 'el SVG previo cambió'; exit 1; }
for f in "$FIXTURE_PATH" "$MUSHROOM_PATH" "$COMPACT_PATH" "$REAL_PATH"; do
test -s "$f"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 62b18c1..c50e2a5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -73,11 +73,38 @@ jobs:
run: |
go run ./cmd/commitling gallery --out out/site
test -s out/site/index.html
- ls out/site/svg | wc -l
+ find out/site/svg -type f | wc -l
- name: versión
run: go run ./cmd/commitling version
+ # Every workflow that the web generator and `commitling workflow` can
+ # produce (the web builds the same bytes; a test compares them) must be
+ # a valid GitHub Actions workflow that uses @v1: actionlint (official
+ # binary, pinned SHA-256) also runs shellcheck on its `run:` script.
+ - name: workflows generados (actionlint)
+ if: runner.os == 'Linux'
+ env:
+ ACTIONLINT_VERSION: "1.7.12"
+ ACTIONLINT_SHA256: "8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8"
+ run: |
+ set -euo pipefail
+ go build -o "$RUNNER_TEMP/commitling" ./cmd/commitling
+ mkdir -p out/wf
+ "$RUNNER_TEMP/commitling" workflow > out/wf/base.yml 2>/dev/null
+ for sp in moss mushroom; do for th in light dark both; do for sz in full compact; do
+ "$RUNNER_TEMP/commitling" workflow --user octocat --species "$sp" --theme "$th" --size "$sz" > "out/wf/$sp-$th-$sz.yml" 2>/dev/null
+ done; done; done
+ if grep -L 'uses: BertMarti/commitling@v1$' out/wf/*.yml | grep .; then echo "sin @v1"; exit 1; fi
+ if grep -l 'commitling@main' out/wf/*.yml; then echo "con @main"; exit 1; fi
+ tgz="actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
+ curl -fsSLo "$RUNNER_TEMP/$tgz" "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/$tgz"
+ echo "${ACTIONLINT_SHA256} $RUNNER_TEMP/$tgz" | sha256sum -c -
+ tar -xzf "$RUNNER_TEMP/$tgz" -C "$RUNNER_TEMP" actionlint
+ command -v shellcheck
+ "$RUNNER_TEMP/actionlint" -color out/wf/*.yml .github/workflows/*.yml
+ echo "$(find out/wf -name "*.yml" | wc -l) workflows generados válidos"
+
# Security checks: known vulnerabilities in Go and its standard library
# (govulncheck), static analysis (staticcheck, also for the wasm build) and
# secrets in the whole history and the working tree (gitleaks, official
diff --git a/AGENTS.md b/AGENTS.md
index da987d7..1739de2 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -62,6 +62,8 @@ Una mascota pixel-art **original** que vive en el README de tu perfil de GitHub.
- **Nada de `${{ }}` dentro de un script `run:`** (ni en `action.yml` ni en los workflows): las entradas y contextos llegan por `env:`. Lo vigila `TestNoExpressionsInRunScripts`.
- Workflows con `permissions` explícitos (Pages: `{}` arriba y lo justo por job) y `persist-credentials: false` en cada `checkout` (`TestWorkflowsAreLeastPrivilege`).
- **CSP de la web** (`` en `index.html.tmpl`): no se admiten `
+