mirror of
https://github.com/actions/setup-node.git
synced 2026-07-27 22:41:53 +00:00
chore: update setup-node action version from v6 to v7 in documentation
This commit is contained in:
parent
e01a1d82a6
commit
4e537a8615
14
README.md
14
README.md
@ -38,7 +38,7 @@ See [action.yml](action.yml)
|
||||
|
||||
<!-- start usage -->
|
||||
```yaml
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
# Version Spec of the version to use in SemVer notation.
|
||||
# It also admits such aliases as lts/*, latest, nightly and canary builds
|
||||
@ -120,7 +120,7 @@ See [action.yml](action.yml)
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 24
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -170,7 +170,7 @@ See the examples of using cache for `yarn`/`pnpm` and `cache-dependency-path` in
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 24
|
||||
cache: 'npm'
|
||||
@ -183,7 +183,7 @@ steps:
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 24
|
||||
cache: 'npm'
|
||||
@ -199,7 +199,7 @@ This behavior is controlled by the `package-manager-cache` input, which defaults
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
package-manager-cache: false
|
||||
- run: npm ci
|
||||
@ -219,7 +219,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -234,7 +234,7 @@ jobs:
|
||||
To get a higher rate limit, you can [generate a personal access token on github.com](https://github.com/settings/tokens/new) and pass it as the `token` input for the action:
|
||||
|
||||
```yaml
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
token: ${{ secrets.GH_DOTCOM_TOKEN }}
|
||||
node-version: 24
|
||||
|
||||
@ -46,7 +46,7 @@ To run without a lockfile:
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24'
|
||||
package-manager-cache: false # Explicitly disable caching if you don't have a lockfile
|
||||
@ -65,7 +65,7 @@ If `check-latest` is set to `true`, the action first checks if the cached versio
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24'
|
||||
check-latest: true
|
||||
@ -84,7 +84,7 @@ See [supported version syntax](https://github.com/actions/setup-node#supported-v
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -129,7 +129,7 @@ jobs:
|
||||
name: Node sample
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24'
|
||||
architecture: 'x64' # optional, x64 or x86. If not specified, x64 will be used by default
|
||||
@ -151,7 +151,7 @@ jobs:
|
||||
name: Node sample
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24.0.0-v8-canary' # it will install the latest v8 canary release for node 24.0.0
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -167,7 +167,7 @@ jobs:
|
||||
name: Node sample
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24-v8-canary' # it will install the latest v8 canary release for node 24
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -184,7 +184,7 @@ jobs:
|
||||
name: Node sample
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 'v24.0.0-v8-canary2025030537242e55ac'
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -205,7 +205,7 @@ jobs:
|
||||
name: Node sample
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24-nightly' # it will install the latest nightly release for node 24
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -222,7 +222,7 @@ jobs:
|
||||
name: Node sample
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24.0.0-nightly' # it will install the latest nightly release for node 24.0.0
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -239,7 +239,7 @@ jobs:
|
||||
name: Node sample
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24.0.0-nightly202505066102159fa1'
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -258,7 +258,7 @@ jobs:
|
||||
name: Node sample
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24.0.0-rc.4'
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -277,7 +277,7 @@ Yarn caching handles both Yarn Classic (v1) and Yarn Berry (v2, v3, v4+).
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24'
|
||||
cache: 'yarn'
|
||||
@ -299,7 +299,7 @@ steps:
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24'
|
||||
cache: 'pnpm'
|
||||
@ -315,7 +315,7 @@ steps:
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24'
|
||||
cache: 'npm'
|
||||
@ -328,7 +328,7 @@ steps:
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24'
|
||||
cache: 'npm'
|
||||
@ -351,7 +351,7 @@ steps:
|
||||
# version: 10
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24'
|
||||
package-manager-cache: false # Disable automatic npm caching if not required
|
||||
@ -397,9 +397,9 @@ jobs:
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
node_version:
|
||||
- 20
|
||||
- 22
|
||||
- 24
|
||||
- 26
|
||||
architecture:
|
||||
- x64
|
||||
# an extra windows-x86 run:
|
||||
@ -411,7 +411,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
architecture: ${{ matrix.architecture }}
|
||||
@ -424,7 +424,7 @@ jobs:
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
@ -433,7 +433,7 @@ steps:
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
package-manager-cache: false # Disable automatic npm dependency caching to reduce cache poisoning risk
|
||||
@ -446,7 +446,7 @@ steps:
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24.x'
|
||||
registry-url: <registry url>
|
||||
@ -455,7 +455,7 @@ steps:
|
||||
- run: yarn publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.YARN_TOKEN }}
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
package-manager-cache: false # Disable automatic npm dependency caching to reduce cache poisoning risk
|
||||
@ -468,7 +468,7 @@ steps:
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
@ -489,7 +489,7 @@ Below you can find a sample "Setup .yarnrc.yml" step, that is going to allow you
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24.x'
|
||||
package-manager-cache: false # Disable automatic npm dependency caching to reduce cache poisoning risk
|
||||
@ -535,7 +535,7 @@ You must also configure a **Trusted Publisher** in npm for your package/scope th
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
@ -558,7 +558,7 @@ It is possible to specify a token to authenticate with the mirror using the `mir
|
||||
The token will be passed in the `Authorization` header.
|
||||
|
||||
```yaml
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24.x'
|
||||
mirror: 'https://nodejs.org/dist'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user