Skip to content

Commit d79e93a

Browse files
committed
docs: add package.json information
1 parent bb59d50 commit d79e93a

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

docs/advanced-usage.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ steps:
4848
- uses: actions/checkout@v3
4949
- uses: actions/setup-node@v3
5050
with:
51-
node-version: '14'
51+
node-version: '16'
5252
check-latest: true
5353
- run: npm ci
5454
- run: npm test
5555
```
5656
5757
## Node version file
5858
59-
The `node-version-file` input accepts a path to a file containing the version of Node.js to be used by a project, for example `.nvmrc`, `.node-version` or `.tool-versions`. If both the `node-version` and the `node-version-file` inputs are provided then the `node-version` input is used.
60-
See [supported version syntax](https://github.com/actions/setup-node#supported-version-syntax)
59+
The `node-version-file` input accepts a path to a file containing the version of Node.js to be used by a project, for example `.nvmrc`, `.node-version`, `.tool-versions`, or `package.json`. If both the `node-version` and the `node-version-file` inputs are provided then the `node-version` input is used.
60+
See [supported version syntax](https://github.com/actions/setup-node#supported-version-syntax).
6161

6262
> The action will search for the node version file relative to the repository root.
6363

@@ -71,6 +71,19 @@ steps:
7171
- run: npm test
7272
```
7373

74+
When using the `package.json` input, the action will look for `volta.node` first. If `volta.node` isn't defined, then it will look for `engines.node`.
75+
76+
```json
77+
{
78+
"engines": {
79+
"node": ">=16.0.0"
80+
},
81+
"volta": {
82+
"node": "16.0.0"
83+
}
84+
}
85+
```
86+
7487
## Architecture
7588

7689
You can use any of the [supported operating systems](https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners), and the compatible `architecture` can be selected using `architecture`. Values are `x86`, `x64`, `arm64`, `armv6l`, `armv7l`, `ppc64le`, `s390x` (not all of the architectures are available on all platforms).

0 commit comments

Comments
 (0)