A collection of reusable GitHub Actions for SF Studios.
Installs Node.js dependencies with automatic package manager detection and caching.
Supports: npm, yarn, pnpm, and bun.
- Optionally checks out the repository (if
branchis provided) - Auto-detects the package manager from the lock file:
bun.lockborbun.lock→ bunyarn.lock→ yarnpnpm-lock.yaml→ pnpmpackage-lock.json→ npm
- Resolves the node and bun version files (see below)
- Sets up the runtime (actions/setup-node, pnpm/setup, and/or oven-sh/setup-bun) with built-in caching and
@sfstudiosregistry auth - Runs the appropriate install command (
npm ci,yarn install --frozen-lockfile,pnpm install --frozen-lockfile, orbun install --frozen-lockfile)
Resolved in order, first match wins:
- node:
node-version-fileinput,mise.toml,.mise.toml,.config/mise/config.toml,.tool-versions,.nvmrc - bun:
bun-version-fileinput,.tool-versions,.bun-version
.tool-versions counts only if it pins that tool; Mise config takes precedence.
mise.toml is node-only, since
setup-bun cannot read it. A bun project with no bun version file fails rather than
installing latest.
pnpm projects must pin pnpm 11 or newer with packageManager or
devEngines.packageManager in package.json.
| Input | Required | Default | Description |
|---|---|---|---|
NPM_TOKEN |
yes | — | Token for private GitHub Packages registry |
branch |
no | "" |
Git ref to checkout. Leave empty to skip checkout. |
package-manager |
no | "auto" |
Force npm, yarn, pnpm, bun, or auto (detect from lock file) |
node-version-file |
no | "" |
File to read Node.js version from. Empty to auto-detect. |
bun-version-file |
no | "" |
File to read Bun version from. Empty to auto-detect. |
The action detects the package manager from the lock file in your repository:
- uses: sfstudios/actions/install-node-modules@master
with:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
branch: ${{ github.ref }}If you handle checkout yourself, omit branch:
- uses: actions/checkout@v6
- uses: sfstudios/actions/install-node-modules@master
with:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}- uses: sfstudios/actions/install-node-modules@master
with:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
branch: ${{ github.ref }}
package-manager: bunBackwards-compatible wrapper that calls install-node-modules with package-manager: npm.
Existing workflows using this action will continue to work without changes.
- uses: sfstudios/actions/npm-install-node-modules@master
with:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
branch: ${{ github.ref }}If you were using the old install-node-modules action with yarn, no changes are needed — the action auto-detects yarn.lock and behaves the same way.
If you were using npm-install-node-modules, no changes are needed — the wrapper forwards to the unified action.
- Caching is now handled by
actions/setup-nodebuilt-in cache (global package cache instead ofnode_modules) - Registry auth is handled by
actions/setup-nodebuilt-inregistry-url+NODE_AUTH_TOKEN(no more manual.npmrcmanipulation) - All action dependencies updated to latest versions (
checkout@v7,setup-node@v7,pnpm/setup@v2,setup-bun@v2) - Bun support added via
oven-sh/setup-bun@v2