Skip to content

ci: bump npm before publish for OIDC trusted publishing#9

Merged
cubehouse merged 2 commits intomainfrom
ci/bump-npm-for-oidc
Apr 15, 2026
Merged

ci: bump npm before publish for OIDC trusted publishing#9
cubehouse merged 2 commits intomainfrom
ci/bump-npm-for-oidc

Conversation

@cubehouse
Copy link
Copy Markdown
Member

Trusted publishing needs npm ≥11.5.1. Node 20 ships with npm 10.x — upgrade npm at CI start.

Node 20 ships with npm 10.x, which predates trusted-publishing
support. The v7.0.0-alpha.0 release hit E404 on PUT because the
publish command fell back to the placeholder NODE_AUTH_TOKEN
setup-node injects when no real token is configured. npm >= 11.5.1
natively understands OIDC trusted publishing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 15, 2026 12:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the npm publishing GitHub Actions workflow to ensure CI uses an npm version new enough to support OIDC trusted publishing/provenance when running on Node 20 (which ships with npm 10.x).

Changes:

  • Install a newer npm globally in the release workflow before running npm ci and publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org
- run: npm install -g npm@latest # trusted publishing requires npm >= 11.5.1
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using npm@latest makes releases non-deterministic and can break unexpectedly when npm 12+ is released (or if latest starts requiring a newer Node than 20). Since the requirement is just >= 11.5.1, pin to a safe range like npm@^11.5.1 (or an exact version) and optionally add a npm --version check to fail fast if the install didn’t take effect.

Suggested change
- run: npm install -g npm@latest # trusted publishing requires npm >= 11.5.1
- run: |
npm install -g npm@^11.5.1 # trusted publishing requires npm >= 11.5.1
npm --version

Copilot uses AI. Check for mistakes.
@cubehouse cubehouse merged commit c7a1761 into main Apr 15, 2026
3 checks passed
@cubehouse cubehouse deleted the ci/bump-npm-for-oidc branch April 15, 2026 12:46
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.

2 participants