Skip to content

Commit 16af4c4

Browse files
authored
Merge pull request #2902 from github/koesie10/actions-nvmrc
Use .nvmrc file for setting up Node version in Actions
2 parents ff34079 + c970c3b commit 16af4c4

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.github/workflows/cli-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262

6363
- uses: actions/setup-node@v3
6464
with:
65-
node-version: '18.15.0'
65+
node-version-file: extensions/ql-vscode/.nvmrc
6666
cache: 'npm'
6767
cache-dependency-path: extensions/ql-vscode/package-lock.json
6868

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: actions/setup-node@v3
2424
with:
25-
node-version: '18.15.0'
25+
node-version-file: extensions/ql-vscode/.nvmrc
2626
cache: 'npm'
2727
cache-dependency-path: extensions/ql-vscode/package-lock.json
2828

@@ -64,7 +64,7 @@ jobs:
6464

6565
- uses: actions/setup-node@v3
6666
with:
67-
node-version: '18.15.0'
67+
node-version-file: extensions/ql-vscode/.nvmrc
6868
cache: 'npm'
6969
cache-dependency-path: extensions/ql-vscode/package-lock.json
7070

@@ -110,7 +110,7 @@ jobs:
110110

111111
- uses: actions/setup-node@v3
112112
with:
113-
node-version: '18.15.0'
113+
node-version-file: extensions/ql-vscode/.nvmrc
114114
cache: 'npm'
115115
cache-dependency-path: extensions/ql-vscode/package-lock.json
116116

@@ -149,7 +149,7 @@ jobs:
149149

150150
- uses: actions/setup-node@v3
151151
with:
152-
node-version: '18.15.0'
152+
node-version-file: extensions/ql-vscode/.nvmrc
153153
cache: 'npm'
154154
cache-dependency-path: extensions/ql-vscode/package-lock.json
155155

@@ -183,7 +183,7 @@ jobs:
183183

184184
- uses: actions/setup-node@v3
185185
with:
186-
node-version: '18.15.0'
186+
node-version-file: extensions/ql-vscode/.nvmrc
187187
cache: 'npm'
188188
cache-dependency-path: extensions/ql-vscode/package-lock.json
189189

@@ -251,7 +251,7 @@ jobs:
251251

252252
- uses: actions/setup-node@v3
253253
with:
254-
node-version: '18.15.0'
254+
node-version-file: extensions/ql-vscode/.nvmrc
255255
cache: 'npm'
256256
cache-dependency-path: extensions/ql-vscode/package-lock.json
257257

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: actions/setup-node@v3
2424
with:
25-
node-version: '18.15.0'
25+
node-version-file: extensions/ql-vscode/.nvmrc
2626

2727
- name: Install dependencies
2828
run: |

docs/node-version.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ You can find this info by seleting "About Visual Studio Code" from the top menu.
1515

1616
The following files will need to be updated:
1717

18-
- `.github/workflows/cli-test.yml` - the "node-version: '[VERSION]'" setting
19-
- `.github/workflows/main.yml` - all the "node-version: '[VERSION]'" settings
20-
- `.github/workflows/release.yml` - the "node-version: '[VERSION]'" setting
21-
- `extensions/ql-vscode/.nvmrc` - this will enable nvm to automatically switch to the correct node version when you're in the project folder
22-
- `extensions/ql-vscode/package-lock.json` - the "engines.node: '[VERSION]'" setting
18+
- `extensions/ql-vscode/.nvmrc` - this will enable nvm to automatically switch to the correct Node
19+
version when you're in the project folder. It will also change the Node version the GitHub Actions
20+
workflows use.
2321
- `extensions/ql-vscode/package.json` - the "engines.node: '[VERSION]'" setting
2422
- `extensions/ql-vscode/package.json` - the "@types/node: '[VERSION]'" dependency
2523

24+
Then run `npm install` to update the `extensions/ql-vscode/package-lock.json` file.
25+
2626
## Node.js version used in tests
2727

2828
Unit tests will use whatever version of Node.js is installed locally. In CI this will be the version specified in the workflow.

0 commit comments

Comments
 (0)