Skip to content

fix(release): publish via npm trusted publishing (OIDC) - #126

Merged
wyvern8 merged 1 commit into
masterfrom
fix/npm-trusted-publishing
Nov 3, 2026
Merged

wyvern8 merged 1 commit into
masterfrom
fix/npm-trusted-publishing

Conversation

@wyvern8

@wyvern8 wyvern8 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Fixes the failed release (SemanticReleaseError: Invalid npm token, run 39901074004) by switching to npm Trusted Publishing (GitHub Actions OIDC). No NPM_TOKEN needed.

Changes

  • semantic-release ^17.4.7 → ^25.0.9 (brings @semantic-release/npm 13.x with OIDC trusted publishing; requires Node ^22.14 || >=24.10).
  • release.yml: checkout/setup-node v4, Node 22, registry-url: https://registry.npmjs.org, npm install -g npm@latest (trusted publishing needs npm >= 11.5.1), job permissions contents/issues/pull-requests: write + id-token: write, uses secrets.GITHUB_TOKEN, NPM_TOKEN removed, fetch-depth: 0.
  • ci.yml: v4 actions, Node 22, --frozen-lockfile.
  • package.json: publishConfig: { access: public, provenance: true } (provenance is automatic with trusted publishing anyway). repository already matches github.com/zotoio/launchdarkly-nodeutils.
  • yarn build / yarn test pass locally on Node 22 (51 passing).

Required npmjs setup BEFORE merging (merge triggers a release)

npmjs.com → package launchdarkly-nodeutils → Settings → Trusted Publisher → GitHub Actions:

  • Organization or user: zotoio
  • Repository: launchdarkly-nodeutils
  • Workflow filename: release.yml
  • Environment: (blank)

Optional hardening afterwards: Settings → Publishing access → "Require two-factor authentication and disallow tokens".

After a successful trusted release, the NPM_TOKEN (and GH_TOKEN) repo secrets can be deleted and the npm token revoked.

Note: if master has branch protection that blocks the GITHUB_TOKEN from pushing tags, it still works because semantic-release's default config only pushes tags (no commits to master).

Upgrade semantic-release to v25 (@semantic-release/npm 13) for OIDC trusted publishing with provenance, move workflows to Node 22 and v4 actions, use GITHUB_TOKEN and drop NPM_TOKEN.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T01:15:18.739469Z a27d456 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@wyvern8
wyvern8 merged commit dd72e1a into master Nov 3, 2026
2 checks passed
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 4.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant