From 68339699ebd47c29daf788d561ec48e978a5826f Mon Sep 17 00:00:00 2001 From: Mike Odnis Date: Thu, 30 Jul 2026 01:10:00 -0400 Subject: [PATCH] fix(node-ci): set up Node for bun projects too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setup-node was gated `if: package-manager != 'bun'`, on the assumption bun projects don't need Node. But native and postinstall deps (sharp, cypress, …) spawn `node` during `bun install`. On GitHub-hosted runners the system Node is modern so it worked by accident; on a self-hosted runner with an old system Node, `bun install` crashes in the postinstall (e.g. cypress's cli parsed under Node 12 → "Unexpected token ="). Runs setup-node for every package manager now. bun still gets setup-bun; it just also gets a pinned modern Node on PATH. No npm/yarn/pnpm cache is enabled for bun (it manages its own store), so nothing else changes for bun callers, and non-bun paths are byte-identical. --- .github/workflows/node-ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 3be3144..342341f 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -109,12 +109,16 @@ jobs: with: bun-version: ${{ inputs.bun-version }} - - if: ${{ inputs.package-manager != 'bun' }} - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + # Runs for EVERY package manager, bun included. bun is the PM/runtime, but + # native and postinstall deps (sharp, cypress, …) spawn `node` during + # `bun install`, so a modern Node must be on PATH regardless — otherwise + # a runner whose system `node` is old (common on self-hosted) crashes the + # install. No npm/yarn/pnpm cache for bun; bun manages its own store. + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version: ${{ inputs.node-version }} - cache: ${{ inputs.package-manager == 'yarn' && 'yarn' || inputs.package-manager == 'pnpm' && 'pnpm' || 'npm' }} - cache-dependency-path: ${{ inputs.cache-dependency-path }} + cache: ${{ inputs.package-manager == 'yarn' && 'yarn' || inputs.package-manager == 'pnpm' && 'pnpm' || inputs.package-manager == 'npm' && 'npm' || '' }} + cache-dependency-path: ${{ inputs.package-manager == 'bun' && '' || inputs.cache-dependency-path }} - name: Install env: