Skip to content

ci: publish via npm Trusted Publishing (OIDC), drop NPM_TOKEN#4

Merged
agarciar merged 1 commit into
mainfrom
ci/trusted-publishing
May 25, 2026
Merged

ci: publish via npm Trusted Publishing (OIDC), drop NPM_TOKEN#4
agarciar merged 1 commit into
mainfrom
ci/trusted-publishing

Conversation

@agarciar
Copy link
Copy Markdown
Contributor

Switches the release workflow from a long-lived NPM_TOKEN secret to npm Trusted Publishing (OIDC).

  • Removes env.NODE_AUTH_TOKEN / the NPM_TOKEN secret dependency.
  • Installs npm@latest in the job to guarantee OIDC support (npm ≥ 11.5.1).
  • id-token: write (already present) lets npm exchange the GitHub Actions OIDC token for a short-lived publish credential and attach provenance automatically.

Before the first OIDC release works, two one-time steps are needed (outside this PR):

  1. The package must exist on npm — npm has no "pending publisher", so bootstrap with one manual npm publish (tokenless via npm login).
  2. Configure the Trusted Publisher on npmjs.com → package Settings → Trusted Publisher → GitHub Actions: repo lostium/angular-deploy-bunny, workflow publish.yml.

After that, every GitHub release publishes via OIDC with no stored secret.

🤖 Generated with Claude Code

Switch the release workflow to OIDC trusted publishing: remove the
NODE_AUTH_TOKEN/NPM_TOKEN secret and let npm (>=11.5.1, installed in the job)
exchange the GitHub Actions id-token for a short-lived publish credential,
attaching provenance automatically. Requires a Trusted Publisher configured
for the package on npmjs.com (repo lostium/angular-deploy-bunny, workflow
publish.yml).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@agarciar agarciar merged commit 9ec5397 into main May 25, 2026
7 checks passed
@agarciar agarciar deleted the ci/trusted-publishing branch May 25, 2026 16:19
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