Skip to content

Commit 546fd45

Browse files
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
1 parent bacd6b4 commit 546fd45

File tree

4 files changed

+35
-33
lines changed

4 files changed

+35
-33
lines changed

Diff for: .github/workflows/build-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
os: [ubuntu-latest, windows-latest, macos-latest]
2020
steps:
2121
- uses: actions/checkout@v2
22-
- name: Setup node 16
23-
uses: actions/setup-node@v2
22+
- name: Setup Node 16.x
23+
uses: actions/setup-node@v3
2424
with:
2525
node-version: 16.x
2626
cache: npm
2727
- run: npm ci
2828
- run: npm run build
2929
- run: npm run format-check
30-
- run: npm test
30+
- run: npm test

Diff for: .github/workflows/check-dist.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v2
2525

26-
- name: Set Node.js 16.x
27-
uses: actions/setup-node@v2
26+
- name: Setup Node 16.x
27+
uses: actions/setup-node@v3
2828
with:
2929
node-version: 16.x
3030
cache: npm

Diff for: README.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# setup-node
22

3-
<p align="left">
4-
<a href="https://github.com/actions/setup-node/actions?query=workflow%3Abuild-test"><img alt="build-test status" src="https://github.com/actions/setup-node/workflows/build-test/badge.svg"></a> <a href="https://github.com/actions/setup-node/actions?query=workflow%3Aversions"><img alt="versions status" src="https://github.com/actions/setup-node/workflows/versions/badge.svg"></a> <a href="https://github.com/actions/setup-node/actions?query=workflow%3Aproxy"><img alt="proxy status" src="https://github.com/actions/setup-node/workflows/proxy/badge.svg"></a>
5-
</p>
3+
[![build-test](https://github.com/actions/setup-node/actions/workflows/build-test.yml/badge.svg)](https://github.com/actions/setup-node/actions/workflows/build-test.yml)
4+
[![versions](https://github.com/actions/setup-node/actions/workflows/versions.yml/badge.svg)](https://github.com/actions/setup-node/actions/workflows/versions.yml)
5+
[![proxy](https://github.com/actions/setup-node/actions/workflows/proxy.yml/badge.svg)](https://github.com/actions/setup-node/actions/workflows/proxy.yml)
66

77
This action provides the following functionality for GitHub Actions users:
88

@@ -19,25 +19,26 @@ See [action.yml](action.yml)
1919
```yaml
2020
steps:
2121
- uses: actions/checkout@v2
22-
- uses: actions/setup-node@v2
22+
- uses: actions/setup-node@v3
2323
with:
2424
node-version: '14'
2525
- run: npm install
2626
- run: npm test
2727
```
2828
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.
3030

3131
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/).
3232

3333
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).
3434

3535
#### Supported version syntax
36+
3637
The `node-version` input supports the following syntax:
3738

38-
major versions: `12`, `14`, `16`
39-
more specific versions: `10.15`, `14.2.0`, `16.3.0`
40-
nvm lts syntax: `lts/erbium`, `lts/fermium`, `lts/*`
39+
major versions: `12`, `14`, `16`
40+
more specific versions: `10.15`, `14.2.0`, `16.3.0`
41+
nvm lts syntax: `lts/erbium`, `lts/fermium`, `lts/*`
4142

4243
## Caching packages dependencies
4344

@@ -51,7 +52,7 @@ See the examples of using cache for `yarn` / `pnpm` and `cache-dependency-path`
5152
```yaml
5253
steps:
5354
- uses: actions/checkout@v2
54-
- uses: actions/setup-node@v2
55+
- uses: actions/setup-node@v3
5556
with:
5657
node-version: '14'
5758
cache: 'npm'
@@ -63,7 +64,7 @@ steps:
6364
```yaml
6465
steps:
6566
- uses: actions/checkout@v2
66-
- uses: actions/setup-node@v2
67+
- uses: actions/setup-node@v3
6768
with:
6869
node-version: '14'
6970
cache: 'npm'
@@ -73,6 +74,7 @@ steps:
7374
```
7475

7576
## Matrix Testing:
77+
7678
```yaml
7779
jobs:
7880
build:
@@ -84,7 +86,7 @@ jobs:
8486
steps:
8587
- uses: actions/checkout@v2
8688
- name: Setup node
87-
uses: actions/setup-node@v2
89+
uses: actions/setup-node@v3
8890
with:
8991
node-version: ${{ matrix.node }}
9092
- run: npm install

Diff for: docs/advanced-usage.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If `check-latest` is set to `true`, the action first checks if the cached versio
1111
```yaml
1212
steps:
1313
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v2
14+
- uses: actions/setup-node@v3
1515
with:
1616
node-version: '14'
1717
check-latest: true
@@ -20,15 +20,15 @@ steps:
2020
```
2121
2222
## 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)
2626
> The action will search for the node version file relative to the repository root.
2727

2828
```yaml
2929
steps:
3030
- uses: actions/checkout@v2
31-
- uses: actions/setup-node@v2
31+
- uses: actions/setup-node@v3
3232
with:
3333
node-version-file: '.nvmrc'
3434
- run: npm install
@@ -47,7 +47,7 @@ jobs:
4747
name: Node sample
4848
steps:
4949
- uses: actions/checkout@v2
50-
- uses: actions/setup-node@v2
50+
- uses: actions/setup-node@v3
5151
with:
5252
node-version: '14'
5353
architecture: 'x64' # optional, x64 or x86. If not specified, x64 will be used by default
@@ -58,12 +58,12 @@ jobs:
5858
## Caching packages dependencies
5959
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.
6060

61-
**Caching yarn dependencies:**
61+
**Caching yarn dependencies:**
6262
Yarn caching handles both yarn versions: 1 or 2.
6363
```yaml
6464
steps:
6565
- uses: actions/checkout@v2
66-
- uses: actions/setup-node@v2
66+
- uses: actions/setup-node@v3
6767
with:
6868
node-version: '14'
6969
cache: 'yarn'
@@ -85,7 +85,7 @@ steps:
8585
- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
8686
with:
8787
version: 6.10.0
88-
- uses: actions/setup-node@v2
88+
- uses: actions/setup-node@v3
8989
with:
9090
node-version: '14'
9191
cache: 'pnpm'
@@ -97,7 +97,7 @@ steps:
9797
```yaml
9898
steps:
9999
- uses: actions/checkout@v2
100-
- uses: actions/setup-node@v2
100+
- uses: actions/setup-node@v3
101101
with:
102102
node-version: '14'
103103
cache: 'npm'
@@ -110,7 +110,7 @@ steps:
110110
```yaml
111111
steps:
112112
- uses: actions/checkout@v2
113-
- uses: actions/setup-node@v2
113+
- uses: actions/setup-node@v3
114114
with:
115115
node-version: '14'
116116
cache: 'npm'
@@ -148,7 +148,7 @@ jobs:
148148
steps:
149149
- uses: actions/checkout@v2
150150
- name: Setup node
151-
uses: actions/setup-node@v2
151+
uses: actions/setup-node@v3
152152
with:
153153
node-version: ${{ matrix.node_version }}
154154
architecture: ${{ matrix.architecture }}
@@ -160,15 +160,15 @@ jobs:
160160
```yaml
161161
steps:
162162
- uses: actions/checkout@v2
163-
- uses: actions/setup-node@v2
163+
- uses: actions/setup-node@v3
164164
with:
165165
node-version: '14.x'
166166
registry-url: 'https://registry.npmjs.org'
167167
- run: npm install
168168
- run: npm publish
169169
env:
170170
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
171-
- uses: actions/setup-node@v2
171+
- uses: actions/setup-node@v3
172172
with:
173173
registry-url: 'https://npm.pkg.github.com'
174174
- run: npm publish
@@ -180,15 +180,15 @@ steps:
180180
```yaml
181181
steps:
182182
- uses: actions/checkout@v2
183-
- uses: actions/setup-node@v2
183+
- uses: actions/setup-node@v3
184184
with:
185185
node-version: '14.x'
186186
registry-url: <registry url>
187187
- run: yarn install
188188
- run: yarn publish
189189
env:
190190
NODE_AUTH_TOKEN: ${{ secrets.YARN_TOKEN }}
191-
- uses: actions/setup-node@v2
191+
- uses: actions/setup-node@v3
192192
with:
193193
registry-url: 'https://npm.pkg.github.com'
194194
- run: yarn publish
@@ -200,7 +200,7 @@ steps:
200200
```yaml
201201
steps:
202202
- uses: actions/checkout@v2
203-
- uses: actions/setup-node@v2
203+
- uses: actions/setup-node@v3
204204
with:
205205
node-version: '14.x'
206206
registry-url: 'https://registry.npmjs.org'

0 commit comments

Comments
 (0)