Skip to content

fix(ci): make npm trusted publishing actually work (unblocks npmjs releases)#192

Merged
simonrosenberg merged 1 commit into
mainfrom
fix-npm-publish-trusted
May 27, 2026
Merged

fix(ci): make npm trusted publishing actually work (unblocks npmjs releases)#192
simonrosenberg merged 1 commit into
mainfrom
fix-npm-publish-trusted

Conversation

@simonrosenberg
Copy link
Copy Markdown
Member

Problem

The Publish to npm workflow (npm-publish.yml) gates on npm >= 11.5.1 (required for OIDC trusted publishing) but never upgrades npm. Node 22 bundles npm 10.9.8, so the guard fails and the job exits before publishing.

This is why v1.24.0 published to GitHub Packages but not to npmjs.org — the npmjs job failed at Error: npm 11.5.1+ required for trusted publishing, got 10.9.8. (1.23.3 was last published before this workflow existed, so the workflow had never actually succeeded.)

Fix

  • Upgrade npm to latest after setup-node so the version guard passes.
  • Add workflow_dispatch (with a version input) so an already-pushed tag can be re-published to npmjs.org without moving the tag or re-running the GH-Packages release. The published tarball excludes .github/, so dispatching from the default branch yields package contents identical to the tag.

After merge

Run Publish to npm via workflow_dispatch with version=1.24.0 to get @openhands/typescript-client@1.24.0 (the switchAcpModel release, #189) onto npmjs.org, which is where agent-canvas pins.

🤖 Generated with Claude Code

The 'Publish to npm' workflow gates on npm >= 11.5.1 (required for OIDC
trusted publishing) but never upgrades npm — Node 22 bundles npm 10.x, so the
guard fails and the job exits before publishing. This is why v1.24.0 published
to GitHub Packages but not to npmjs.org (and 1.23.3 was last published before
this workflow existed).

- Upgrade npm to latest after setup-node so the guard passes.
- Add a workflow_dispatch (version input) so an already-pushed tag can be
  re-published to npmjs.org without moving the tag / re-running the GH Packages
  release. The published tarball excludes .github/, so dispatching from the
  default branch yields identical package contents to the tag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@simonrosenberg simonrosenberg merged commit d99da7e into main May 27, 2026
7 checks passed
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