Skip to content

Commit df69370

Browse files
committed
Install standard version of Node.js in "Deploy Website" workflow
The "Deploy Website" workflow invokes the following chain of tasks: 1. `docs:generate` 2. `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 runs 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"} npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2024-10-16T07_28_37_785Z-debug-0.log task: Failed to run task "docs:generate": exit status 1 ``` 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 659b86c commit df69370

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml

+8
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ on:
1717
paths:
1818
- "docs/**"
1919
- ".github/workflows/deploy-cobra-mkdocs-versioned-poetry.ya?ml"
20+
- "**/.npmrc"
2021
- "go.mod"
2122
- "go.sum"
2223
- "Taskfile.ya?ml"
2324
- "**.go"
2425
- "docsgen/**"
2526
- "ruledocsgen/**"
2627
- "mkdocs.ya?ml"
28+
- "package.json"
29+
- "package-lock.json"
2730
- "poetry.lock"
2831
- "pyproject.toml"
2932
# Run on branch or tag creation (will be filtered by the publish-determination job).
@@ -80,6 +83,11 @@ jobs:
8083
python -m pip install --upgrade pip
8184
python -m pip install poetry
8285
86+
- name: Setup Node.js
87+
uses: actions/setup-node@v4
88+
with:
89+
node-version-file: package.json
90+
8391
- name: Install Task
8492
uses: arduino/setup-task@v2
8593
with:

0 commit comments

Comments
 (0)