Skip to content

Commit 7a66fef

Browse files
committed
Install standard version of Node.js in "Check Website" workflow
The "Check Website" workflow invokes the following chain of tasks: 1. `website:check` 2. `docs:generate` 3. `general:format-prettier` This makes the Prettier tool a dependency of the workflow, which in turn introduces a dependency on npm, and thus on Node.js. Previously, the workflow didn't contain a step to run the "actions/setup-node" action, so it used whichever version of npm happened to be installed in the runner machine, which happens to be 18.x currently. Now that the use of the project's standard Node.js version 20.x is enforced, this caused the workflow to fail spuriously: ``` task: [npm:install-deps] npm install npm error code EBADENGINE npm error engine Unsupported engine npm error engine Not compatible with your version of node/npm: undefined npm error notsup Not compatible with your version of node/npm: undefined npm error notsup Required: {"node":"20.x"} npm error notsup Actual: {"npm":"10.7.0","node":"v18.20.4"} ``` The problem is solved by adding an "actions/setup-node" action step to the workflow to install the correct version of Node.js.
1 parent bb0b097 commit 7a66fef

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/check-mkdocs-task.yml

+11
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ on:
1313
push:
1414
paths:
1515
- ".github/workflows/check-mkdocs-task.ya?ml"
16+
- "**/.npmrc"
1617
- "Taskfile.ya?ml"
1718
- "mkdocs.ya?ml"
19+
- "package.json"
20+
- "package-lock.json"
1821
- "poetry.lock"
1922
- "pyproject.toml"
2023
- "docs/**"
@@ -24,8 +27,11 @@ on:
2427
pull_request:
2528
paths:
2629
- ".github/workflows/check-mkdocs-task.ya?ml"
30+
- "**/.npmrc"
2731
- "Taskfile.ya?ml"
2832
- "mkdocs.ya?ml"
33+
- "package.json"
34+
- "package-lock.json"
2935
- "poetry.lock"
3036
- "pyproject.toml"
3137
- "docs/**"
@@ -87,6 +93,11 @@ jobs:
8793
- name: Install Poetry
8894
run: pip install poetry
8995

96+
- name: Setup Node.js
97+
uses: actions/setup-node@v4
98+
with:
99+
node-version-file: package.json
100+
90101
- name: Install Task
91102
uses: arduino/setup-task@v2
92103
with:

0 commit comments

Comments
 (0)