Skip to content

Commit 397c82f

Browse files
authored
Merge pull request #1029 from arduino/engine
Use engines.node as source of version data for actions/setup-node action
2 parents f6a7bd0 + a57ecf9 commit 397c82f

12 files changed

+41
-48
lines changed

.github/workflows/check-action-metadata-task.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
name: Check Action Metadata
22

3-
env:
4-
# See: https://github.com/actions/setup-node/#readme
5-
NODE_VERSION: 20.x
6-
73
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
84
on:
95
push:
106
paths:
117
- ".github/workflows/check-action-metadata-task.ya?ml"
8+
- ".npmrc"
129
- "action.ya?ml"
1310
- "package.json"
1411
- "package-lock.json"
1512
- "Taskfile.ya?ml"
1613
pull_request:
1714
paths:
1815
- ".github/workflows/check-action-metadata-task.ya?ml"
16+
- ".npmrc"
1917
- "action.ya?ml"
2018
- "package.json"
2119
- "package-lock.json"
@@ -37,7 +35,7 @@ jobs:
3735
- name: Setup Node.js
3836
uses: actions/setup-node@v4
3937
with:
40-
node-version: ${{ env.NODE_VERSION }}
38+
node-version-file: package.json
4139

4240
- name: Install Task
4341
uses: arduino/setup-task@v2

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

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

4-
env:
5-
# See: https://github.com/actions/setup-node/#readme
6-
NODE_VERSION: 16.x
7-
84
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
95
on:
106
push:
117
paths:
128
- ".github/workflows/check-markdown-task.ya?ml"
139
- ".markdown-link-check.json"
10+
- ".npmrc"
1411
- "package.json"
1512
- "package-lock.json"
1613
- "Taskfile.ya?ml"
@@ -23,6 +20,7 @@ on:
2320
paths:
2421
- ".github/workflows/check-markdown-task.ya?ml"
2522
- ".markdown-link-check.json"
23+
- ".npmrc"
2624
- "package.json"
2725
- "package-lock.json"
2826
- "Taskfile.ya?ml"
@@ -48,7 +46,7 @@ jobs:
4846
- name: Setup Node.js
4947
uses: actions/setup-node@v4
5048
with:
51-
node-version: ${{ env.NODE_VERSION }}
49+
node-version-file: package.json
5250

5351
- name: Initialize markdownlint-cli problem matcher
5452
uses: xt0rted/markdownlint-problem-matcher@v3
@@ -72,7 +70,7 @@ jobs:
7270
- name: Setup Node.js
7371
uses: actions/setup-node@v4
7472
with:
75-
node-version: ${{ env.NODE_VERSION }}
73+
node-version-file: package.json
7674

7775
- name: Install Task
7876
uses: arduino/setup-task@v2

.github/workflows/check-npm-dependencies-task.yml

+4-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-dependencies-task.md
22
name: Check npm Dependencies
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/using-workflows/events-that-trigger-workflows
95
on:
106
create:
@@ -16,6 +12,7 @@ on:
1612
- ".licensed.ya?ml"
1713
- "Taskfile.ya?ml"
1814
- "**/.gitmodules"
15+
- "**/.npmrc"
1916
- "**/package.json"
2017
- "**/package-lock.json"
2118
pull_request:
@@ -26,6 +23,7 @@ on:
2623
- ".licensed.ya?ml"
2724
- "Taskfile.ya?ml"
2825
- "**/.gitmodules"
26+
- "**/.npmrc"
2927
- "**/package.json"
3028
- "**/package-lock.json"
3129
schedule:
@@ -78,7 +76,7 @@ jobs:
7876
- name: Setup Node.js
7977
uses: actions/setup-node@v4
8078
with:
81-
node-version: ${{ env.NODE_VERSION }}
79+
node-version-file: package.json
8280

8381
- name: Install Task
8482
uses: arduino/setup-task@v2
@@ -128,7 +126,7 @@ jobs:
128126
- name: Setup Node.js
129127
uses: actions/setup-node@v4
130128
with:
131-
node-version: ${{ env.NODE_VERSION }}
129+
node-version-file: package.json
132130

133131
- name: Install Task
134132
uses: arduino/setup-task@v2

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

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
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: 16.x
7-
84
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
95
on:
106
push:
117
paths:
128
- ".github/workflows/check-npm-task.ya?ml"
9+
- "**/.npmrc"
1310
- "**/package.json"
1411
- "**/package-lock.json"
1512
- "Taskfile.ya?ml"
1613
pull_request:
1714
paths:
1815
- ".github/workflows/check-npm-task.ya?ml"
16+
- "**/.npmrc"
1917
- "**/package.json"
2018
- "**/package-lock.json"
2119
- "Taskfile.ya?ml"
@@ -39,7 +37,7 @@ jobs:
3937
- name: Setup Node.js
4038
uses: actions/setup-node@v4
4139
with:
42-
node-version: ${{ env.NODE_VERSION }}
40+
node-version-file: package.json
4341

4442
- name: Install Task
4543
uses: arduino/setup-task@v2
@@ -60,7 +58,7 @@ jobs:
6058
- name: Setup Node.js
6159
uses: actions/setup-node@v4
6260
with:
63-
node-version: ${{ env.NODE_VERSION }}
61+
node-version-file: package.json
6462

6563
- name: Install Task
6664
uses: arduino/setup-task@v2

.github/workflows/check-prettier-formatting-task.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
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/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
95
on:
106
push:
117
paths:
128
- ".github/workflows/check-prettier-formatting-task.ya?ml"
139
- "Taskfile.ya?ml"
10+
- "**/.npmrc"
1411
- "**/.prettierignore"
1512
- "**/.prettierrc*"
1613
# CSS
@@ -107,6 +104,7 @@ on:
107104
paths:
108105
- ".github/workflows/check-prettier-formatting-task.ya?ml"
109106
- "Taskfile.ya?ml"
107+
- "**/.npmrc"
110108
- "**/.prettierignore"
111109
- "**/.prettierrc*"
112110
# CSS
@@ -213,7 +211,7 @@ jobs:
213211
- name: Setup Node.js
214212
uses: actions/setup-node@v4
215213
with:
216-
node-version: ${{ env.NODE_VERSION }}
214+
node-version-file: package.json
217215

218216
- name: Install Task
219217
uses: arduino/setup-task@v2

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
name: Check TypeScript Configuration
22

3-
env:
4-
# See: https://github.com/actions/setup-node/#readme
5-
NODE_VERSION: 16.x
6-
73
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
84
on:
95
push:
106
paths:
117
- ".github/workflows/check-tsconfig-task.ya?ml"
128
- "**/tsconfig*.json"
9+
- ".npmrc"
1310
- "package.json"
1411
- "package-lock.json"
1512
- "Taskfile.ya?ml"
1613
pull_request:
1714
paths:
1815
- ".github/workflows/check-tsconfig-task.ya?ml"
1916
- "**/tsconfig*.json"
17+
- ".npmrc"
2018
- "package.json"
2119
- "package-lock.json"
2220
- "Taskfile.ya?ml"
@@ -45,7 +43,7 @@ jobs:
4543
- name: Setup Node.js
4644
uses: actions/setup-node@v4
4745
with:
48-
node-version: ${{ env.NODE_VERSION }}
46+
node-version-file: package.json
4947

5048
- name: Install Task
5149
uses: arduino/setup-task@v2

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
name: Check TypeScript
22

3-
env:
4-
# See: https://github.com/actions/setup-node/#readme
5-
NODE_VERSION: 20.x
6-
73
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
84
on:
95
push:
106
paths:
117
- ".github/workflows/check-typescript-task.ya?ml"
128
- ".eslintignore"
139
- "**/.eslintrc*"
10+
- ".npmrc"
1411
- "package.json"
1512
- "package-lock.json"
1613
- "Taskfile.ya?ml"
@@ -25,6 +22,7 @@ on:
2522
- ".github/workflows/check-typescript-task.ya?ml"
2623
- ".eslintignore"
2724
- "**/.eslintrc*"
25+
- ".npmrc"
2826
- "package.json"
2927
- "package-lock.json"
3028
- "Taskfile.ya?ml"
@@ -51,7 +49,7 @@ jobs:
5149
- name: Setup Node.js
5250
uses: actions/setup-node@v4
5351
with:
54-
node-version: ${{ env.NODE_VERSION }}
52+
node-version-file: package.json
5553

5654
- name: Install Task
5755
uses: arduino/setup-task@v2

.github/workflows/sync-labels-npm.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
name: Sync Labels
33

44
env:
5-
# See: https://github.com/actions/setup-node/#readme
6-
NODE_VERSION: 16.x
75
CONFIGURATIONS_FOLDER: .github/label-configuration-files
86
CONFIGURATIONS_ARTIFACT: label-configuration-files
97

@@ -13,12 +11,14 @@ on:
1311
paths:
1412
- ".github/workflows/sync-labels-npm.ya?ml"
1513
- ".github/label-configuration-files/*.ya?ml"
14+
- ".npmrc"
1615
- "package.json"
1716
- "package-lock.json"
1817
pull_request:
1918
paths:
2019
- ".github/workflows/sync-labels-npm.ya?ml"
2120
- ".github/label-configuration-files/*.ya?ml"
21+
- ".npmrc"
2222
- "package.json"
2323
- "package-lock.json"
2424
schedule:
@@ -38,7 +38,7 @@ jobs:
3838
- name: Setup Node.js
3939
uses: actions/setup-node@v4
4040
with:
41-
node-version: ${{ env.NODE_VERSION }}
41+
node-version-file: package.json
4242

4343
- name: Download JSON schema for labels configuration file
4444
id: download-schema
@@ -132,7 +132,7 @@ jobs:
132132
- name: Setup Node.js
133133
uses: actions/setup-node@v4
134134
with:
135-
node-version: ${{ env.NODE_VERSION }}
135+
node-version-file: package.json
136136

137137
- name: Merge label configuration files
138138
run: |

.github/workflows/test-typescript-task.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
name: Test TypeScript
22

3-
env:
4-
# See: https://github.com/actions/setup-node/#readme
5-
NODE_VERSION: 20.x
6-
73
on:
84
push:
95
paths:
106
- ".github/workflows/test-typescript-task.ya?ml"
7+
- ".npmrc"
118
- "jest.config.js"
129
- "package.json"
1310
- "package-lock.json"
@@ -21,6 +18,7 @@ on:
2118
pull_request:
2219
paths:
2320
- ".github/workflows/test-typescript-task.ya?ml"
21+
- ".npmrc"
2422
- "jest.config.js"
2523
- "package.json"
2624
- "package-lock.json"
@@ -54,7 +52,7 @@ jobs:
5452
- name: Setup Node.js
5553
uses: actions/setup-node@v4
5654
with:
57-
node-version: ${{ env.NODE_VERSION }}
55+
node-version-file: package.json
5856

5957
- name: Install Task
6058
uses: arduino/setup-task@v2
@@ -75,7 +73,7 @@ jobs:
7573
- name: Setup Node.js
7674
uses: actions/setup-node@v4
7775
with:
78-
node-version: ${{ env.NODE_VERSION }}
76+
node-version-file: package.json
7977

8078
- name: Install Task
8179
uses: arduino/setup-task@v2

.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# See: https://docs.npmjs.com/cli/configuring-npm/npmrc
2+
3+
engine-strict = true

package-lock.json

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

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,8 @@
4646
"strip-json-comments-cli": "^3.0.0",
4747
"ts-jest": "^28.0.8",
4848
"typescript": "^5.5.4"
49+
},
50+
"engines": {
51+
"node": "20.x"
4952
}
5053
}

0 commit comments

Comments
 (0)