You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated documentation/workflows to use actions/setup-node@v3 (#433)
* Update documentation `actions/setup-node@v2` -> `actions/setup-node@v3`
* Bump workflows to `actions/setup-node@v3`
* Update `README.md` workflow status badges to new format
This action provides the following functionality for GitHub Actions users:
8
8
@@ -19,25 +19,26 @@ See [action.yml](action.yml)
19
19
```yaml
20
20
steps:
21
21
- uses: actions/checkout@v2
22
-
- uses: actions/setup-node@v2
22
+
- uses: actions/setup-node@v3
23
23
with:
24
24
node-version: '14'
25
25
- run: npm install
26
26
- run: npm test
27
27
```
28
28
29
-
The `node-version` input is optional. If not supplied, the node version from PATH will be used. However, it is recommended to always specify Node.js version and don't rely on the system one.
29
+
The `node-version` input is optional. If not supplied, the node version from PATH will be used. However, it is recommended to always specify Node.js version and don't rely on the system one.
30
30
31
31
The action will first check the local cache for a semver match. If unable to find a specific version in the cache, the action will attempt to download a version of Node.js. It will pull LTS versions from [node-versions releases](https://github.com/actions/node-versions/releases) and on miss or failure will fall back to the previous behavior of downloading directly from [node dist](https://nodejs.org/dist/).
32
32
33
33
For information regarding locally cached versions of Node.js on GitHub hosted runners, check out [GitHub Actions Virtual Environments](https://github.com/actions/virtual-environments).
34
34
35
35
#### Supported version syntax
36
+
36
37
The `node-version` input supports the following syntax:
37
38
38
-
major versions: `12`, `14`, `16`
39
-
more specific versions: `10.15`, `14.2.0`, `16.3.0`
Copy file name to clipboardExpand all lines: docs/advanced-usage.md
+17-17
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ If `check-latest` is set to `true`, the action first checks if the cached versio
11
11
```yaml
12
12
steps:
13
13
- uses: actions/checkout@v2
14
-
- uses: actions/setup-node@v2
14
+
- uses: actions/setup-node@v3
15
15
with:
16
16
node-version: '14'
17
17
check-latest: true
@@ -20,15 +20,15 @@ steps:
20
20
```
21
21
22
22
## Node version file
23
-
24
-
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` or `.node-version`. If both the `node-version` and the `node-version-file` inputs are provided then the `node-version` input is used.
25
-
See [supported version syntax](https://github.com/actions/setup-node#supported-version-syntax)
23
+
24
+
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` or `.node-version`. If both the `node-version` and the `node-version-file` inputs are provided then the `node-version` input is used.
25
+
See [supported version syntax](https://github.com/actions/setup-node#supported-version-syntax)
26
26
> The action will search for the node version file relative to the repository root.
27
27
28
28
```yaml
29
29
steps:
30
30
- uses: actions/checkout@v2
31
-
- uses: actions/setup-node@v2
31
+
- uses: actions/setup-node@v3
32
32
with:
33
33
node-version-file: '.nvmrc'
34
34
- run: npm install
@@ -47,7 +47,7 @@ jobs:
47
47
name: Node sample
48
48
steps:
49
49
- uses: actions/checkout@v2
50
-
- uses: actions/setup-node@v2
50
+
- uses: actions/setup-node@v3
51
51
with:
52
52
node-version: '14'
53
53
architecture: 'x64' # optional, x64 or x86. If not specified, x64 will be used by default
@@ -58,12 +58,12 @@ jobs:
58
58
## Caching packages dependencies
59
59
The action follows [actions/cache](https://github.com/actions/cache/blob/main/examples.md#node---npm) guidelines, and caches global cache on the machine instead of `node_modules`, so cache can be reused between different Node.js versions.
0 commit comments