Repository navigation
fix(ci): pin npm exactly and drop obsolete npm upgrade steps - #10651
Merged
Merged
Conversation
OpenSSF Scorecard's Pinned-Dependencies check flags several unpinned install commands in CI. Three of them are worth fixing rather than dismissing. publish.yml installed `npm@11`, a floating range that currently resolves to 11.20.0. That install happens inside the publish job, which holds `id-token: write` plus the npm trusted-publishing identity, and runs immediately before `npm publish --provenance`. A compromised or simply broken npm 11.x release would execute there with no review. Pin the exact version instead. 11.19.1 is the newest 11.x that satisfies the repo's own 7-day `minimumReleaseAge` policy; 11.20.0 shipped yesterday. The existing constraints still hold: >= 11.5.1 for trusted publishing, < 12 because npm 12 dropped the bundled `sigstore` that `--provenance` needs (npm/cli#9722). prepare-release.yml and upgrade-dependencies.yml each installed [email protected] to work around npm/cli#8690, a lockfile `peer` attribute bug in the npm 11.6.2 that Node 24 used to bundle. The comment said to remove the step once Node shipped npm 11.6.3 or later; that happened in Node v24.13.1 (npm 11.8.0), and v24.21.0 (what `setup-node` with `node-version: 24` resolves to today) bundles npm 11.19.0. The step is therefore not just obsolete, it actively downgrades npm by twelve minor versions before regenerating the lockfile. Removing it uses the npm that ships with the pinned Node and clears the alerts. deploy-bot-layer.sh builds the production Bot Lambda layer that customer bots execute on. It runs `npm install` against a copied package.json with no lockfile, in a job that holds AWS deploy credentials, so every transitive dependency resolves fresh and its lifecycle scripts run. Add `--ignore-scripts`. Nothing in the tree needs one: ssh2's install script only builds its native addon when the optional `cpu-features`/`nan` deps are present, and `--omit=optional` already excludes them. Signed-off-by: Derrick Farris <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
noahsilas
approved these changes
Sep 23, 2026
Comment on lines
-35
to
-40
| # npm 11.6.2 is currently bundled with Node v24 and has an irksome bug affecting | ||
| # `peer` attributes in the lockfile (https://github.com/npm/cli/issues/8690). | ||
| # Upgrade to a patched version; this should be removed after Node has a tagged | ||
| # release incorporating [email protected] or later. | ||
| - name: Upgrade NPM | ||
| run: npm install --global [email protected] |
Contributor
There was a problem hiding this comment.
Thanks for catching this! I meant to remove it a ways back but it fell off my radar. Oops!
pull Bot
pushed a commit
to Zezo-Ai/ZezoAi-medplum
that referenced
this pull request
Sep 24, 2026
## What's Changed * feature(dw): remove the data warehouse from the OSS repo. (medplum#10640) * fix(server): add file extension to vite seed config import (medplum#10540) * fix(ci): pin npm exactly and drop obsolete npm upgrade steps (medplum#10651) * feat(server): write a history tombstone on $expunge (medplum#10436) * Lift ScheduleAvailabilityEditor's state so a parent form can hold it (medplum#10642) * Remove dotenv and dependency cleanup (medplum#10654) * [SchedulingWorkspace] Cancel appointment adjustments (medplum#10657) **Full Changelog**: medplum/medplum@v5.1.40...v5.1.41 Signed-off-by: Medplum Bot <[email protected]>
This branch was successfully deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Addresses the OpenSSF Scorecard Pinned-Dependencies alerts that relate to CI and release tooling.
Changes
.github/workflows/publish.ymlnpm install -g npm@11→[email protected].github/workflows/prepare-release.yml.github/workflows/upgrade-dependencies.ymlscripts/deploy-bot-layer.sh--ignore-scriptsto the Bot Lambda layer install#485 —
npm@11is a floating range. The install runs inside the publish job, which holdsid-token: writeand the npm trusted-publishing identity, immediately beforenpm publish --provenance.11.19.1is the newest 11.x that clears this repo's own 7-dayminimumReleaseAgepolicy (11.20.0 shipped 2026-09-22). Both existing constraints still hold:>= 11.5.1for trusted publishing,< 12because npm 12 dropped the bundledsigstorethat--provenanceneeds (npm/cli#9722).#490 / #491 — Both steps installed
[email protected]to work around npm/cli#8690, a lockfilepeerattribute bug in the npm 11.6.2 that Node 24 used to bundle. The inline comment said to remove the step once Node shipped npm 11.6.3 or later. That happened in Node v24.13.1 (npm 11.8.0), and v24.21.0 — whatsetup-nodewithnode-version: '24'resolves to today — bundles npm 11.19.0. The step was no longer just redundant: it was downgrading npm by twelve minor versions right before regeneratingpackage-lock.json.#420 —
deploy-bot-layer.shbuilds the production Bot Lambda layer that customer bots run on. It copiespackages/bot-layer/package.jsoninto a temp dir and runsnpm installwith no lockfile, in jobs (publish.yml,staging.yml) that hold AWS deploy credentials, so every transitive dependency resolves fresh and its lifecycle scripts run.--ignore-scriptsis safe here: the only package in the tree with an install script isssh2, whose script only builds its native addon when the optionalcpu-features/nandeps are present, and--omit=optionalalready excludes them.Verified
uses:reference across.github/workflows/and.github/actions/is already SHA-pinned (38 distinct refs; the only non-SHAuses:is the local reusable workflow./.github/workflows/vouch-check-pr-shared.yml). No changes needed.prettier --checkpasses on all four touched files. Unrelated pre-existing formatting failures elsewhere were left alone.bash -n scripts/deploy-bot-layer.shpasses.Deliberately not addressed
These can be dismissed in the Scorecard UI with the reasons below.
packages/app/Dockerfile:1,nginxinc/nginx-unprivileged:alpine) — a version-tag pin would not clear the alert; Scorecard requires a digest for Docker images, and.github/renovate.jsondeliberately setspinDigests: falsefor the "Docker images" group. Changing that is a Renovate policy decision, not a CI fix, and it changes the published app image, so it belongs in its own PR.packages/agent/Dockerfile:1,debian:bullseye-slim) — no workflow or script builds this Dockerfile. The real issue is that Debian 11 LTS ended 2026-08-31, so this wants a base bump tobookworm-slim/trixie-slimor deletion, not a pin. Out of scope here.Dockerfile:24,32,dhi.io/node:24.18-dev/24.18) — intentional. Renovate is configured withpinDigests: falsefordhi.io/node; DHI rebuilds frequently for CVE patches and tag tracking is how those are picked up.scripts/reinstall.sh:26) — intentional. That line runs only on the--updatepath, whose entire purpose is to regeneratepackage-lock.json; the result goes through PR review. The default path already usesnpm ci.madge.yml:53) — already handled in fix(ci): scope workflow token permissions and drop dormant madge workflow #10649, which deletes the workflow.Full lockfile pinning for the bot layer (#420) would need a committed
packages/bot-layer/npm-shrinkwrap.jsonandnpm ci. That is a larger change, complicated by the lockfile having to reference@medplum/*versions that are not published yet at prepare-release time, so it is left for a follow-up.🤖 Generated with Claude Code