Conditionally installs NodeJS along with pnpm, as well as the dependencies listed in package.json.
steps:
- uses: actions/checkout@v4
- uses: giancosta86/aurora-github/actions/setup-nodejs-context@v8
Please, note: this action is automatically run by verify-npm-package and publish-npm-package.
-
If package.json - which must exist - declares the following field:
{ "engines": { "node": "..." } }
an entire NodeJS toolchain will be set up; in particular:
-
The requested NodeJS version - or a compatible one, if a range is passed - will be installed via actions/setup-node
-
pnpm will be downloaded via pnpm/action-setup.
As for the version:
-
if package.json explicitly provides a
packageManager
reference:{ "packageManager": "pnpm@..." }
it will be resolved
-
otherwise, the latest version will be installed
-
-
-
No matter whether the toolchain was installed, retrieve the dependencies - as follows:
-
🧊 if pnpm-lock.yaml exists, it is considered frozen via the
--frozen-lockfile
flag -
🌞 otherwise,
--no-frozen-lockfile
is passed explicitly
-
-
The package.json descriptor must exist in
project-directory
. -
The
packageManager
field can be missing, but it can't reference another package manager. -
If the pnpm-lock.yaml file exists, it must be up-to-date - because it's considered frozen.
Name | Type | Description | Default value |
---|---|---|---|
project-directory |
string | The directory containing package.json |
. |