Skip to content

fix(ci): inline CI setup, add Node 24 support, harden workflows#1176

Merged
John-David Dalton (jdalton) merged 10 commits intov1.xfrom
fix/v1x-inline-ci-workflows
Apr 8, 2026
Merged

fix(ci): inline CI setup, add Node 24 support, harden workflows#1176
John-David Dalton (jdalton) merged 10 commits intov1.xfrom
fix/v1x-inline-ci-workflows

Conversation

@jdalton
Copy link
Copy Markdown
Contributor

@jdalton John-David Dalton (jdalton) commented Apr 8, 2026

Summary

Our CI workflows used to call a shared composite action (SocketDev/socket-registry/.github/actions/setup-and-install) that was pinned to an old SHA from October 2025 — before Node 24 even existed. Updating it meant chasing SHA cascades across multiple layers of nested actions in another repo.

This PR removes that external dependency entirely. Each workflow now has its setup steps inlined so you can read it top-to-bottom and understand exactly what runs:

  1. Checkout the repo
  2. Install pnpm (native binary, checksum-verified)
  3. Install Node.js (version from the matrix or hardcoded)
  4. Download sfw-free — the Socket Firewall binary, verified with SHA-256 checksums
  5. Create sfw shims — transparent wrappers that route npm/yarn/pnpm through the firewall
  6. Install dependencies via pnpm install

What changed

  • Node 24 support — CI test matrix now covers Node 20, 22, and 24. Provenance publishes use Node 24.
  • SHA-256 checksum verification — Every binary download (pnpm, sfw-free, zizmor) is verified against a hardcoded checksum. If a release asset is tampered with, CI fails immediately.
  • Inline pnpm install — Replaced pnpm/action-setup third-party action with a direct download of the pnpm standalone binary from GitHub releases. Same checksum-verified pattern as sfw-free and zizmor.
  • zizmor security audit — The lint job now runs zizmor, a GitHub Actions security scanner, on every push/PR. It's a native binary (no Docker/Python/pip) downloaded with checksum verification. Warnings (exit 13) are allowed; errors fail the build.
  • Template injection fixinputs.dist-tag in provenance.yml was directly interpolated in run: blocks, which is a code injection vector. Now passed safely through an env var.
  • Cache-poisoning fix — Removed the push + tags: ['*'] trigger from e2e-tests.yml. Combining tag triggers with action caching is a known attack vector.
  • Windows-ready sfw shims — Shims convert MSYS paths to Windows native format and generate .cmd wrappers. Anti-recursion logic strips the shim directory from PATH before exec.
  • Dead workflow cleanup — Removed claude-auto-review.yml, claude.yml, and socket-auto-pr.yml which referenced shared workflows that no longer exist.
  • Removed npm upgrade hacknpm install -g npm@latest in provenance.yml is no longer needed since Node 24 ships with modern npm.
  • Added packageManager fieldpnpm@10.33.0 in package.json, matching all other Socket repos.

Action SHAs pinned

Action Version SHA
actions/checkout v6.0.2 de0fac2e4500dabe0009e67214ff5f5447ce83dd
actions/setup-node v6.3.0 53b83947a5a98c8d113130e565377fae1a50d02f

Binary checksums (SHA-256)

pnpm v10.33.0
Platform Checksum
linux-x64 8d4e8f7d778e8ac482022e2577011706a872542f6f6f233e795a4d9f978ea8b5
linux-arm64 06755ad2817548b84317d857d5c8003dc6e9e28416a3ea7467256c49ab400d48
macos-x64 c31e29554b0e3f4e03f4617195c949595e4dca36085922003de4896c3ca4057d
macos-arm64 ed8a1f140f4de457b01ebe0be3ae28e9a7e28863315dcd53d22ff1e5a32d63ae
windows-x64 afc96009dc39fe23a835d65192049e6a995f342496b175585dc2beda7d42d33f
sfw-free v1.6.1
Platform Checksum
linux-x86_64 4a1e8b65e90fce7d5fd066cf0af6c93d512065fa4222a475c8d959a6bc14b9ff
linux-arm64 df2eedb2daf2572eee047adb8bfd81c9069edcb200fc7d3710fca98ec3ca81a1
macos-x86_64 724ccea19d847b79db8cc8e38f5f18ce2dd32336007f42b11bed7d2e5f4a2566
macos-arm64 bf1616fc44ac49f1cb2067fedfa127a3ae65d6ec6d634efbb3098cfa355e5555
windows-x86_64 c953e62ad7928d4d8f2302f5737884ea1a757babc26bed6a42b9b6b68a5d54af
zizmor v1.23.1
Platform Checksum
linux-x86_64 67a8df0a14352dd81882e14876653d097b99b0f4f6b6fe798edc0320cff27aff
linux-arm64 3725d7cd7102e4d70827186389f7d5930b6878232930d0a3eb058d7e5b47e658
macos-x86_64 89d5ed42081dd9d0433a10b7545fac42b35f1f030885c278b9712b32c66f2597
macos-arm64 2632561b974c69f952258c1ab4b7432d5c7f92e555704155c3ac28a2910bd717
windows-x86_64 33c2293ff02834720dd7cd8b47348aafb2e95a19bdc993c0ecaca9c804ade92a

Test plan

  • CI lint job passes (includes zizmor audit)
  • CI typecheck job passes
  • CI test matrix passes on Node 20, 22, and 24
  • E2E tests pass on PR trigger
  • Provenance workflow still works via manual dispatch

Previously our CI workflows depended on a shared composite action from
the socket-registry repo (setup-and-install). That action was pinned to
an October 2025 SHA that predated Node 24 support, and updating it meant
tracking SHA cascades across multiple layers of nested actions.

This commit replaces that dependency by inlining every setup step
directly into each workflow file. Now each workflow is self-contained
and easy to read top-to-bottom:

  1. actions/checkout   — clone the repo
  2. pnpm/action-setup  — install pnpm (version from package.json)
  3. actions/setup-node  — install the right Node.js version
  4. Download sfw-free   — fetch the Socket Firewall binary
  5. Create sfw shims    — wrap npm/yarn/pnpm through the firewall
  6. pnpm install        — install dependencies (through the firewall)

All three actions are pinned to full commit SHAs (not version tags) so
the exact code that runs is deterministic and auditable.

Binary downloads (sfw-free v1.6.1) are verified against SHA-256
checksums baked into the workflow. If someone tampers with a release
asset, CI will fail immediately instead of running untrusted code.

The sfw shim scripts handle both Linux/macOS and Windows:
- On Windows, MSYS-style paths (/c/Users/...) are converted to native
  format (C:\Users\...) so sfw-free can resolve them correctly.
- .cmd wrapper files are generated alongside bash shims for Windows.
- Each shim strips its own directory from PATH before exec to prevent
  infinite recursion (shim calling itself instead of the real binary).

Other changes:

- Node 24 is now tested in the CI matrix alongside Node 20 and 22.
  Provenance publishes with Node 24.

- The lint job now runs zizmor (a GitHub Actions security auditor) on
  every push/PR. It downloads a pinned, checksum-verified native binary
  — no Docker, Python, or pip needed. It scans .github/ for template
  injection, unpinned actions, cache poisoning, and other issues.

- Removed three dead workflow files that referenced shared workflows
  which no longer exist upstream: claude-auto-review.yml, claude.yml,
  and socket-auto-pr.yml.

- Fixed template injection in provenance.yml: inputs.dist-tag was
  interpolated directly into run blocks (attackable via workflow
  dispatch). Now passed through an environment variable instead.

- Removed the push/tag trigger from e2e-tests.yml to eliminate a
  cache-poisoning vector flagged by zizmor (PR + tag triggers combined
  with action caching).

- Removed the old npm install -g npm@latest hack from provenance.yml
  since Node 24 ships with a modern npm.
@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 8, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgithub/​actions/​setup-node@​53b83947a5a98c8d113130e565377fae1a50d02f99100100100100
Updatedgithub/​actions/​checkout@​08c6903cd8c0fde910a37f88322edcfb5dd907a8 ⏵ de0fac2e4500dabe0009e67214ff5f5447ce83dd100 +1100100100100

View full report

@socket-security-staging
Copy link
Copy Markdown

socket-security-staging bot commented Apr 8, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgithub/​actions/​checkout@​08c6903cd8c0fde910a37f88322edcfb5dd907a8 ⏵ de0fac2e4500dabe0009e67214ff5f5447ce83dd92100100100100
Addedgithub/​actions/​setup-node@​53b83947a5a98c8d113130e565377fae1a50d02f99100100100100

View full report

Replace the pnpm/action-setup third-party action with a direct download
of the pnpm standalone binary from GitHub releases, matching the same
pattern used for sfw-free and zizmor.

The pnpm binary (v10.33.0) is downloaded, checksum-verified against a
SHA-256 hash, and symlinked as "pnpm" on PATH. This removes the last
third-party action dependency beyond actions/checkout and
actions/setup-node.
Aligns socket-cli with all other Socket repos which already declare
packageManager in package.json. This lets corepack and tooling auto-
detect the correct pnpm version.
Zizmor exits 13 for warnings-only and 14 for errors. The
secrets-outside-env warnings are expected (requires GitHub environment
configuration) so we allow exit code 13 while still failing on actual
errors.
@jdalton John-David Dalton (jdalton) merged commit f2129b1 into v1.x Apr 8, 2026
12 checks passed
@jdalton John-David Dalton (jdalton) deleted the fix/v1x-inline-ci-workflows branch April 8, 2026 20:01
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