Skip to content

Use engines.node as source of version data for "actions/setup-node" action #590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/check-clang-format.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Check ClangFormat Configuration

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
push:
Expand Down Expand Up @@ -48,7 +44,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -229,7 +225,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/check-eslint.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Check ESLint Configuration

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
push:
Expand Down Expand Up @@ -38,7 +34,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/check-javascript-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-javascript-task.md
name: Check JavaScript

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -68,7 +64,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/check-markdown-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-markdown-task.md
name: Check Markdown

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -77,7 +73,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Initialize markdownlint-cli problem matcher
uses: xt0rted/markdownlint-problem-matcher@v3
Expand Down Expand Up @@ -105,7 +101,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/check-npm-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-npm-task.md
name: Check npm

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -73,7 +69,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -106,7 +102,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: "${{ matrix.project.path }}/package.json"

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-prettier-formatting-task.md
name: Check Prettier Formatting

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -245,7 +241,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/check-taskfiles.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-taskfiles.md
name: Check Taskfiles

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -74,7 +70,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Download JSON schema for Taskfiles
id: download-schema
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/check-workflows-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-workflows-task.md
name: Check Workflows

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
push:
Expand Down Expand Up @@ -36,7 +32,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/sync-labels-npm.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels-npm.md
name: Sync Labels

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x
CONFIGURATIONS_FOLDER: .github/label-configuration-files
CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file-

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
push:
Expand All @@ -27,6 +21,10 @@ on:
workflow_dispatch:
repository_dispatch:

env:
CONFIGURATIONS_FOLDER: .github/label-configuration-files
CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file-

jobs:
check:
runs-on: ubuntu-latest
Expand All @@ -40,7 +38,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Download JSON schema for labels configuration file
id: download-schema
Expand Down Expand Up @@ -136,7 +134,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Merge label configuration files
run: |
Expand Down
3 changes: 1 addition & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
The following development tools must be available in your local environment:

- [**Node.js** / **npm**](https://nodejs.org/en/download/) - Node.js dependencies management tool
- <!-- NODE_VERSION -->
This project uses Node.js 16.x
- The **Node.js** version in use is defined by the `engines.node` key of [`package.json`](../package.json).
- [**Python**](https://wiki.python.org/moin/BeginnersGuide/Download)
- <!-- PYTHON_VERSION -->
This project uses Python 3.9.x
Expand Down
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
},
"dependencies": {
"js-yaml": "^4.1.0"
},
"engines": {
"node": "16.x"
}
}
12 changes: 8 additions & 4 deletions workflow-templates/check-action-metadata-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ Commit the resulting changes to the `package.json` and `package-lock.json` files

### Configuration

#### Workflow

Configure the version of **Node.js** used for development of the project in the `env.NODE_VERSION` field of `check-action-metadata-task.yml`.

#### `.gitignore`

Add the following to [`/.gitignore`](https://git-scm.com/docs/gitignore):
Expand All @@ -45,6 +41,14 @@ Add the following to [`/.gitignore`](https://git-scm.com/docs/gitignore):
/node_modules/
```

#### Node.js

Configure the version of [**Node.js**](https://nodejs.org) used for development of the project by running the following command from a terminal in the project repository folder:

```text
npm pkg set engines.node=16.x
```

### Readme badge

Markdown badge:
Expand Down
6 changes: 1 addition & 5 deletions workflow-templates/check-action-metadata-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-action-metadata-task.md
name: Check Action Metadata

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -67,7 +63,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
12 changes: 8 additions & 4 deletions workflow-templates/check-javascript-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ Commit the resulting changes to the `package.json` and `package-lock.json` files

### Configuration

#### Workflow

Configure the version of [**Node.js**](https://nodejs.org) used for development of the project in the `env.NODE_VERSION` field of `check-javascript-task.yml`.

#### `.gitignore`

Add the following to [`/.gitignore`](https://git-scm.com/docs/gitignore):
Expand All @@ -51,6 +47,14 @@ Add the following to [`/.gitignore`](https://git-scm.com/docs/gitignore):
/node_modules/
```

#### Node.js

Configure the version of [**Node.js**](https://nodejs.org) used for development of the project by running the following command from a terminal in the project repository folder:

```text
npm pkg set engines.node=16.x
```

### Readme badge

Markdown badge:
Expand Down
6 changes: 1 addition & 5 deletions workflow-templates/check-javascript-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-javascript-task.md
name: Check JavaScript

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -68,7 +64,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
8 changes: 6 additions & 2 deletions workflow-templates/check-markdown-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ Commit the resulting changes to the `package.json` and `package-lock.json` files

### Configuration

#### Workflow
#### Node.js

Configure the version of Node.js used for development of the project in the `env.NODE_VERSION` field of `check-markdown-task.yml`.
Configure the version of [**Node.js**](https://nodejs.org) used for development of the project by running the following command from a terminal in the project repository folder:

```text
npm pkg set engines.node=16.x
```

#### Taskfile

Expand Down
8 changes: 2 additions & 6 deletions workflow-templates/check-markdown-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-markdown-task.md
name: Check Markdown

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -77,7 +73,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Initialize markdownlint-cli problem matcher
uses: xt0rted/markdownlint-problem-matcher@v3
Expand Down Expand Up @@ -105,7 +101,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
Loading
Loading