Skip to content

ci(release): run on Node 22 with registry-pinned npm (INF-864) - #974

Open
dylanschmittle-uniswap wants to merge 1 commit into
mainfrom
dylanschmittle/inf-864-sor-release-node22
Open

dylanschmittle-uniswap wants to merge 1 commit into
mainfrom
dylanschmittle/inf-864-sor-release-node22

Conversation

@dylanschmittle-uniswap

Copy link
Copy Markdown
Collaborator

Summary

  • Release workflow node-version 20 -> "22.23.4" (npm trusted publishing needs Node >= 22.14; matches Uniswap/default-token-list#2661).
  • Replace the npm install -g github:npm/cli#<sha> install with registry-pinned npm install -g npm@11.6.3 --ignore-scripts (same pin as the other repos).
  • No release-build caching exists in the workflow (setup-node has no cache:, no actions/cache), so nothing to remove.
  • Only .github/workflows/release.yml changes.

Linear: INF-864 (part of INF-859, npm OIDC/2FA hardening)

Validation

  • zizmor v1.33.1 offline on the workflow: before = 1 low adhoc-packages (the git-sha npm install, 4 suppressed); after = still 1 low adhoc-packages on the npm@11.6.3 line (4 suppressed), 0 medium/high. Same rule at the same step; it flags any global install outside a lockfile, so it is not new and not made worse.
  • npm view npm@11.6.3 version returns 11.6.3; Node 22.23.4 verified on nodejs.org dist.

Test plan

  • After merge, run the Release workflow (workflow_dispatch) and confirm the published version shows _npmUser.trustedPublisher and provenance on the npm registry.

@linear-code

linear-code Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

INF-859

INF-864


- name: Install npm
run: npm install -g github:npm/cli#6d1db8724b1d0e5457a87bb31e62e43d566348ce --ignore-scripts # npm@11.7.0
run: npm install -g npm@11.6.3 --ignore-scripts

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium severity blocking issue identified in your code:
npm@11.6.3 --ignore-scripts
An npm script inside an action on GitHub is not pinned to a full length commit SHA. Pinning the npm package to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

To resolve this comment:

✨ Commit fix suggestion

Suggested change
run: npm install -g npm@11.6.3 --ignore-scripts
# Replace with the verified 40-character commit SHA for the official npm@11.6.3 release.
run: npm install -g npm@git+https://github.com/npm/cli.git#<VERIFIED_VALUE_REQUIRED> --ignore-scripts
View step-by-step instructions
  1. Identify the full 40-character Git commit SHA in the npm/cli repository that corresponds to the npm@11.6.3 release.

  2. Replace the version-based installation with the immutable Git reference:
    run: npm install -g npm@git+https://github.com/npm/cli.git#<40-character-commit-sha> --ignore-scripts

  3. Keep --ignore-scripts enabled so package lifecycle scripts do not execute during the global installation.

  4. Confirm that the selected commit is the official npm@11.6.3 release commit, rather than a branch or tag, before using it in the workflow.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by npm-package-in-action-not-pinned-to-commit-sha.

You can view more details about this finding in the Semgrep AppSec Platform.

@dylanschmittle-uniswap
dylanschmittle-uniswap marked this pull request as ready for review December 3, 2026 20:32
@dylanschmittle-uniswap
dylanschmittle-uniswap requested a review from a team as a code owner December 3, 2026 20:32

This branch has not been deployed

No deployments
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