mirror of
https://github.com/actions/setup-node
synced 2025-04-15 04:46:03 +00:00
Merge 6f485d0d11
into 49933ea528
This commit is contained in:
commit
035837f4ff
15
README.md
15
README.md
@ -102,6 +102,7 @@ steps:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
check-latest: true
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm test
|
- run: npm test
|
||||||
```
|
```
|
||||||
@ -118,12 +119,13 @@ The `node-version` input supports the Semantic Versioning Specification, for mor
|
|||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
- Major versions: `18`, `20`
|
- Specific versions: `10.15`, `16.15.1` , `18.4.0`
|
||||||
- More specific versions: `10.15`, `16.15.1` , `18.4.0`
|
- Version ranges (see **Caching Caveat** below)
|
||||||
- NVM LTS syntax: `lts/erbium`, `lts/fermium`, `lts/*`, `lts/-n`
|
- Major versions: `18`, `20`
|
||||||
- Latest release: `*` or `latest`/`current`/`node`
|
- NVM LTS syntax: `lts/erbium`, `lts/fermium`, `lts/*`, `lts/-n`
|
||||||
|
- Latest release: `*` or `latest`/`current`/`node`
|
||||||
|
|
||||||
**Note:** Like the other values, `*` will get the latest [locally-cached Node.js version](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#nodejs), or the latest version from [actions/node-versions](https://github.com/actions/node-versions/blob/main/versions-manifest.json), depending on the [`check-latest`](docs/advanced-usage.md#check-latest-version) input.
|
**Caching Caveat:** Version ranges may be cached for an indefinite time without the `check-latest: true` option - they may be stale for [durations up to 1 month](https://github.com/actions/setup-node/issues/1236#issuecomment-2704188519)
|
||||||
|
|
||||||
`current`/`latest`/`node` always resolve to the latest [dist version](https://nodejs.org/dist/index.json).
|
`current`/`latest`/`node` always resolve to the latest [dist version](https://nodejs.org/dist/index.json).
|
||||||
That version is then downloaded from actions/node-versions if possible, or directly from Node.js if not.
|
That version is then downloaded from actions/node-versions if possible, or directly from Node.js if not.
|
||||||
@ -151,6 +153,7 @@ steps:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
check-latest: true
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm test
|
- run: npm test
|
||||||
@ -164,6 +167,7 @@ steps:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
check-latest: true
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
cache-dependency-path: subdir/package-lock.json
|
cache-dependency-path: subdir/package-lock.json
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
@ -186,6 +190,7 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
|
check-latest: true
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm test
|
- run: npm test
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user