
Setup Node.js
actions/setup-node
Set up a specific version of Node.js and add it to the PATH
3,200stars
800forks
15.0M uses
CI/CDv4.0.2About
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 testInputs
repositoryRepository name with owner
Default: ${{ github.repository }}
refThe branch, tag or SHA to checkout
tokenPersonal access token (PAT)
Default: ${{ github.token }}
fetch-depthNumber of commits to fetch
Default: 1
Related Actions
Metadata
Language
TypeScript
Last Updated
1/20/2024
Latest Release
v4.0.2