Skip to content

Publica en npm con trusted publishing - #8

Merged
mijhaels merged 1 commit into
mainfrom
ci/npm-trusted-publishing
Oct 12, 2026
Merged

mijhaels merged 1 commit into
mainfrom
ci/npm-trusted-publishing

Conversation

@mijhaels

Copy link
Copy Markdown
Collaborator

Summary

La publicación de 0.2.0 falló porque NPM_TOKEN (de enero de 2024) ya no autoriza: npm error 404 Not Found - PUT https://registry.npmjs.org/tu-ruc-js-client (run).

 publish:
   permissions:
     contents: write
+    id-token: write          # npm intercambia el OIDC de GitHub por un token de un solo uso
 package.json
+  "repository": "git+https://github.com/ithdev/tu-ruc-js-client.git"   # npm lo exige para provenance

Node 24.21.0 trae npm 11.19.0, que ya soporta trusted publishing. Mientras no esté configurado, npm sigue usando NODE_AUTH_TOKEN.

Falta un paso de un dueño del paquete (hoy solo seb5433), con 2FA activo:

npm trust github tu-ruc-js-client --repo ithdev/tu-ruc-js-client --file npm-publish.yml --allow-publish

Evidence

  • Before: el job publish falla con 404 y no se crea ni el tag ni el release.
    After: format:check y lint pasan. La publicación se valida al relanzar CI/CD después de configurar el trusted publisher.

Merge Danger

Door: two-way

Blast Radius: Publicación

No toca el código del paquete. Una vez que funcione, conviene revocar el token viejo y borrar el secreto NPM_TOKEN.

🤖 Generated with Claude Code

The NPM_TOKEN secret no longer authorizes publishes (npm returned 404 on
PUT). Grant the publish job an OIDC token and declare the repository so
npm can verify the workflow and attach provenance. npm still falls back
to NODE_AUTH_TOKEN while the trusted publisher is not configured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mijhaels
mijhaels merged commit 857a818 into main Oct 12, 2026
3 checks passed
@mijhaels
mijhaels deleted the ci/npm-trusted-publishing branch October 27, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant