Skip to content

anantacloud-actions/setup-node

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ Setup NodeJS

image

The smartest way to set up Node.js in GitHub Actions.
Zero guesswork. Maximum speed. Built for modern CI.


Please note: We take our GitHub action's security and users' trust very seriously. If you believe you have found a security issue in any of our GitHub action, please responsibly disclose by contacting us at security@anantacloud.com.


πŸš€ Why Setup Node.js Pro?

Most Node setup actions stop at installation.
This one goes further.

  • Auto-detects package manager (npm, yarn, pnpm)
  • Supports .nvmrc, .node-version, package.json, .tool-versions
  • Semver-aware version resolution
  • Cross-platform (Linux, macOS, Windows)
  • Built-in dependency install
  • Matrix-aware intelligent caching
  • Registry + authentication support
  • Mirror support for Node.js binaries
  • Debug mode for deep CI visibility

Think of it as setup-node, but evolved.


⚑ Quick Start

- name: Setup Node.js
  uses: anantacloud-actions/setup-node@v1

🧩 Usage Examples

Use specific Node version

- uses: anantacloud-actions/setup-node@v1
  with:
    node-version: 20

Use version from file

- uses: anantacloud-actions/setup-node@v1
  with:
    node-version-file: .nvmrc

Enable caching

- uses: anantacloud-actions/setup-node@v1
  with:
    cache: npm

Configure private registry

- uses: anantacloud-actions/setup-node@v1
  with:
    registry-url: https://registry.npmjs.org
    token: ${{ secrets.NPM_TOKEN }}

Disable install step

- uses: anantacloud-actions/setup-node@v1
  with:
    install: false

πŸ›  Inputs

Name Description Required Default
node-version Version spec (e.g. 18, 20.x, >=18.0.0) ❌ -
node-version-file File with version (e.g. .nvmrc, package.json) ❌ -
architecture Target architecture (x86, x64, arm64) ❌ system
check-latest Resolve latest matching version ❌ false
registry-url Registry URL for npm/yarn/pnpm ❌ -
scope Scope for registry authentication ❌ repo owner
token Auth token for registry or downloads ❌ github token
cache Package manager cache (npm, yarn, pnpm) ❌ auto
package-manager-cache Enable/disable automatic caching ❌ true
cache-dependency-path Path(s) to dependency files ❌ auto
mirror Alternative Node.js download mirror ❌ nodejs.org
mirror-token Token for mirror authentication ❌ -
install Install dependencies automatically ❌ true
debug Enable debug logging ❌ false

πŸ“€ Outputs

Name Description
node-version Installed Node.js version

🧠 Feature Breakdown

πŸ” Version Resolution Priority

  1. node-version
  2. node-version-file
  3. Error if none provided

πŸ“¦ Auto Package Manager Detection

File Found Manager
pnpm-lock.yaml pnpm
yarn.lock yarn
none npm

⚑ Built-in Install

Manager Command
npm npm ci
yarn yarn install --frozen-lockfile
pnpm pnpm install --frozen-lockfile

⚑ Matrix-Aware Caching

Cache key includes:

  • OS
  • Architecture
  • Node version
  • Lockfile hash

Result: faster and more reliable CI runs.


🌐 Registry Authentication

Supports:

  • npm registry
  • GitHub Packages
  • Custom registries

Automatically configures .npmrc.


🌍 Mirror Support

Use custom mirror for faster downloads or internal networks.


πŸ”₯ Comparison

Feature setup-node Setup Node.js Pro
Auto detect package manager ❌ βœ…
Built-in install ❌ βœ…
Debug logs ❌ βœ…
Matrix-aware cache ⚠️ βœ…
Version file support ⚠️ βœ…
Mirror support ❌ βœ…

🎯 Use Cases

  • Monorepos (pnpm / yarn workspaces)
  • Enterprise CI pipelines
  • Multi-version testing
  • Air-gapped environments (mirror support)
  • Zero-config projects

⭐ Support

If this project helps you, consider giving it a ⭐
It helps others discover it.


πŸ§‘β€πŸ’» Contributing

PRs, issues, and suggestions are welcome.


πŸ“„ License

MIT

About

A TypeScript-based GitHub Action to set up Node.js with smart defaults and minimal configuration.

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors