A collection of reusable GitHub Actions for SF Studios.
Installs Node.js dependencies with automatic package manager detection and caching.
Supports: npm, yarn, and bun.
- Optionally checks out the repository (if
branchis provided) - Auto-detects the package manager from the lock file:
bun.lockborbun.lock→ bunyarn.lock→ yarnpackage-lock.json→ npm
- Sets up the runtime (actions/setup-node and/or oven-sh/setup-bun) with built-in caching and
@sfstudiosregistry auth - Runs the appropriate install command (
npm ci,yarn install --frozen-lockfile, orbun install --frozen-lockfile)
| 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, bun, or auto (detect from lock file) |
node-version-file |
no | ".nvmrc" |
File to read Node.js version from |
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@v6,setup-node@v6,setup-bun@v2) - Bun support added via
oven-sh/setup-bun@v2