Skip to content

Commit eb8c66f

Browse files
authored
Merge pull request #790 from per1234/engines_node
Use engines.node as source of version data for "actions/setup-node" action
2 parents 88a0b28 + d964dd4 commit eb8c66f

6 files changed

+13
-15
lines changed

Diff for: .github/workflows/check-markdown-task.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ name: Check Markdown
44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
66
GO_VERSION: "1.17"
7-
# See: https://github.com/actions/setup-node/#readme
8-
NODE_VERSION: 20.x
97

108
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
119
on:
@@ -79,7 +77,7 @@ jobs:
7977
- name: Setup Node.js
8078
uses: actions/setup-node@v4
8179
with:
82-
node-version: ${{ env.NODE_VERSION }}
80+
node-version-file: package.json
8381

8482
- name: Initialize markdownlint-cli problem matcher
8583
uses: xt0rted/markdownlint-problem-matcher@v3
@@ -112,7 +110,7 @@ jobs:
112110
- name: Setup Node.js
113111
uses: actions/setup-node@v4
114112
with:
115-
node-version: ${{ env.NODE_VERSION }}
113+
node-version-file: package.json
116114

117115
- name: Install Task
118116
uses: arduino/setup-task@v2

Diff for: .github/workflows/check-npm-task.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-npm-task.md
22
name: Check npm
33

4-
env:
5-
# See: https://github.com/actions/setup-node/#readme
6-
NODE_VERSION: 20.x
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -72,7 +68,7 @@ jobs:
7268
- name: Setup Node.js
7369
uses: actions/setup-node@v4
7470
with:
75-
node-version: ${{ env.NODE_VERSION }}
71+
node-version-file: package.json
7672

7773
- name: Install Task
7874
uses: arduino/setup-task@v2
@@ -105,7 +101,7 @@ jobs:
105101
- name: Setup Node.js
106102
uses: actions/setup-node@v4
107103
with:
108-
node-version: ${{ env.NODE_VERSION }}
104+
node-version-file: package.json
109105

110106
- name: Install Task
111107
uses: arduino/setup-task@v2

Diff for: .github/workflows/check-prettier-formatting-task.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-prettier-formatting-task.md
22
name: Check Prettier Formatting
33

4-
env:
5-
# See: https://github.com/actions/setup-node/#readme
6-
NODE_VERSION: 20.x
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -245,7 +241,7 @@ jobs:
245241
- name: Setup Node.js
246242
uses: actions/setup-node@v4
247243
with:
248-
node-version: ${{ env.NODE_VERSION }}
244+
node-version-file: package.json
249245

250246
- name: Install Task
251247
uses: arduino/setup-task@v2

Diff for: docs/CONTRIBUTING.md

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ If you want to run integration tests or work on documentation, you will also nee
8484
- A working [Python](https://www.python.org/downloads/) environment, version 3.9 or later.
8585
- [Poetry](https://python-poetry.org/docs/).
8686
- [**Node.js** / **npm**](https://nodejs.org/en/download/) - Node.js dependencies management tool.
87+
- The **Node.js** version in use is defined in the `engines.node` field of
88+
[`package.json`](https://github.com/arduino/arduino-lint/blob/main/package.json).
8789
- **** [**nvm**](https://github.com/nvm-sh/nvm#installing-and-updating) is recommended if you want to manage multiple
8890
installations of **Node.js** on your system.
8991

Diff for: package-lock.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+3
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
"markdownlint-cli": "0.37.0",
55
"prettier": "3.3.3"
66
},
7+
"engines": {
8+
"node": "20.x"
9+
},
710
"type": "module"
811
}

0 commit comments

Comments
 (0)