You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduces the risk of a compromised npm package or GitHub Action running in CI or ending up in a published release.
npm:.npmrc refuses versions published less than 7 days ago, git and URL dependencies, and unknown config keys. allowScripts in each package.json lists which dependencies may run install scripts. These settings need npm 12, so a shared setup action (.github/actions/setup-node-npm) installs it and applies them to every npm command in CI.
Workflows: every job uses that action and npm ci. Release and GHR backfill skip the npm cache, and release verifies registry signatures before building. Checkouts don't keep credentials on disk, and the Coveralls action is pinned to a commit SHA.
Tests still run on Node 18–24 (jobs install with npm 12, then switch Node to run tests). Nothing changes for SDK users.
Test plan
node scripts/pick-npm-version.js 12 picks 12.2.3, with and without min-release-age in .npmrc.
CI on this PR runs every job in javascript.yml.
release.yml not run yet. workflow_dispatch runs it with DRY_RUN=true.
- Add .npmrc (min-release-age, allow-git/allow-remote=none, strict-npmrc),
symlinked into every sub-project.
- Add the setup-node-npm composite action: Node from .nvmrc, npm 12 chosen
by scripts/pick-npm-version.js, repo .npmrc applied to every npm command,
strict-allow-scripts, public registry forced.
- Use it in all workflows; npm install -> npm ci; checkout/setup-node -> v7;
pin the Coveralls action to a commit SHA.
- release.yml: no npm cache; verify registry signatures before building.
- Add devEngines and allowScripts to the package.json files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Release and backfill jobs still restore npm caches because setup-node v7’s automatic package-manager caching remains enabled despite an empty cache input, violating their explicit no-cache requirement.
This PR hardens the SDK’s npm supply chain by centralizing CI setup and restricting dependency sources, release age, and install scripts, while preserving Node 18 runtime support.
Changes:
Adds shared Node 22/npm 12 setup with age-based npm version selection and repository-wide npm settings.
Updates workflows to use locked installs, safer checkout settings, pinned Coveralls, and release signature verification.
Adds development-tool requirements and install-script policies, refreshes the TypeScript lockfile, and separates CommonJS installation from runtime testing.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Empty cache inputs still trigger setup-node’s automatic npm caching through the new package-manager metadata, so release and backfill jobs restore/save caches despite explicitly requesting no cache.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The TypeScript CI helper still uses npm install for dependencies, allowing stale example lockfiles to be silently updated despite the new npm ci step.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Replace helper npm install calls with npm ci
.github/workflows/javascript.yml:47
The TypeScript job still runs npm install twice through scripts/run-ts-example.js (lines 106 and 114), including for the example's dev dependencies, so the new npm ci step does not deliver the PR's stated switch to frozen-lockfile installs for this job. A stale example lockfile can still be updated silently instead of failing CI. Use npm ci for the helper's dependency-install steps, or install both projects with npm ci here and let the helper skip those steps; keep the local SDK tarball installation separate.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because the CI and release npm selector lacks automated coverage for filtering and version ordering, leaving potential regressions in this supply-chain gate unverified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces the risk of a compromised npm package or GitHub Action running in CI or ending up in a published release.
.npmrcrefuses versions published less than 7 days ago, git and URL dependencies, and unknown config keys.allowScriptsin eachpackage.jsonlists which dependencies may run install scripts. These settings need npm 12, so a shared setup action (.github/actions/setup-node-npm) installs it and applies them to every npm command in CI.npm ci. Release and GHR backfill skip the npm cache, and release verifies registry signatures before building. Checkouts don't keep credentials on disk, and the Coveralls action is pinned to a commit SHA.Tests still run on Node 18–24 (jobs install with npm 12, then switch Node to run tests). Nothing changes for SDK users.
Test plan
node scripts/pick-npm-version.js 12picks 12.2.3, with and withoutmin-release-agein.npmrc.javascript.yml.release.ymlnot run yet.workflow_dispatchruns it withDRY_RUN=true.Issues
🤖 Generated with Claude Code