Actions/actions/setup-node
actions

Setup Node.js

actions/setup-node

View on GitHub

Set up a specific version of Node.js and add it to the PATH

3,200stars
800forks
15.0M uses
CI/CDv4.0.2

About

This action sets up a Node.js environment for use in actions by downloading and caching a version of Node.js and adding it to the PATH. It also optionally sets up npm or yarn package managers.

Workflow Example

name: CI
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
        with:
          fetch-depth: 0
      
      - name: Run tests
        run: npm test

Inputs

repository

Repository name with owner

Default: ${{ github.repository }}

ref

The branch, tag or SHA to checkout

token

Personal access token (PAT)

Default: ${{ github.token }}

fetch-depth

Number of commits to fetch

Default: 1

Metadata

Language

TypeScript

Last Updated

1/20/2024

Latest Release

v4.0.2