Skip to content

Configure npm to enforce standard project Node.js version #593

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
2 changes: 2 additions & 0 deletions .github/workflows/check-clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- "other/clang-format-configuration/scripts/convert-clang-format-configuration.js"
- "other/clang-format-configuration/testdata/**"
- "other/clang-format-configuration/.clang-format"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand All @@ -17,6 +18,7 @@ on:
- "other/clang-format-configuration/scripts/convert-clang-format-configuration.js"
- "other/clang-format-configuration/testdata/**"
- "other/clang-format-configuration/.clang-format"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:
paths:
- ".github/workflows/check-eslint.yml"
- "workflow-templates/assets/check-javascript/.eslintrc.yml"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
pull_request:
paths:
- ".github/workflows/check-eslint.yml"
- "workflow-templates/assets/check-javascript/.eslintrc.yml"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-javascript-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- ".github/workflows/check-javascript-task.ya?ml"
- ".eslintignore"
- "**/.eslintrc*"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand All @@ -18,6 +19,7 @@ on:
- ".github/workflows/check-javascript-task.ya?ml"
- ".eslintignore"
- "**/.eslintrc*"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-markdown-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths:
- ".github/workflows/check-markdown-task.ya?ml"
- ".markdown-link-check.json"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand All @@ -20,6 +21,7 @@ on:
paths:
- ".github/workflows/check-markdown-task.ya?ml"
- ".markdown-link-check.json"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-npm-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
push:
paths:
- ".github/workflows/check-npm-task.ya?ml"
- "**/.npmrc"
- "**/package.json"
- "**/package-lock.json"
- "Taskfile.ya?ml"
pull_request:
paths:
- ".github/workflows/check-npm-task.ya?ml"
- "**/.npmrc"
- "**/package.json"
- "**/package-lock.json"
- "Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
paths:
- ".github/workflows/check-prettier-formatting-task.ya?ml"
- ".npmrc"
- "Taskfile.ya?ml"
- "**/.prettierignore"
- "**/.prettierrc*"
Expand Down Expand Up @@ -103,6 +104,7 @@ on:
pull_request:
paths:
- ".github/workflows/check-prettier-formatting-task.ya?ml"
- ".npmrc"
- "Taskfile.ya?ml"
- "**/.prettierignore"
- "**/.prettierrc*"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-taskfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
push:
paths:
- ".github/workflows/check-taskfiles.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "**/Taskfile.ya?ml"
pull_request:
paths:
- ".github/workflows/check-taskfiles.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "**/Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-workflows-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
push:
paths:
- ".github/workflows/*.ya?ml"
- ".npmrc"
- "Taskfile.ya?ml"
- "workflow-templates/*.ya?ml"
pull_request:
paths:
- ".github/workflows/*.ya?ml"
- ".npmrc"
- "Taskfile.ya?ml"
- "workflow-templates/*.ya?ml"
schedule:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sync-labels-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
paths:
- ".github/workflows/sync-labels-npm.ya?ml"
- ".github/label-configuration-files/*.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
pull_request:
paths:
- ".github/workflows/sync-labels-npm.ya?ml"
- ".github/label-configuration-files/*.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
schedule:
Expand Down
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm/.npmrc
# See: https://docs.npmjs.com/cli/configuring-npm/npmrc

engine-strict=true
1 change: 1 addition & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ tasks:
"{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/general/.editorconfig" \
"{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-python/.flake8" \
"{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-markdown/.markdownlint.yml" \
"{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/npm/.npmrc" \
"{{.REPOSITORY_ROOT_PATH}}"

dependabot:validate:
Expand Down
4 changes: 4 additions & 0 deletions workflow-templates/assets/npm/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm/.npmrc
# See: https://docs.npmjs.com/cli/configuring-npm/npmrc

engine-strict=true
2 changes: 2 additions & 0 deletions workflow-templates/check-action-metadata-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Install the [`check-action-metadata-task.yml`](check-action-metadata-task.yml) G

- [`Taskfile.yml`](assets/check-action-metadata-task/Taskfile.yml) - task for validating `action.yml`
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`.npmrc`](assets/npm/.npmrc) - **npm** configuration file.
- Install to: repository root.
- [`Taskfile.yml`](assets/npm-task/Taskfile.yml) - **npm** tasks.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/windows-task/Taskfile.yml) - utility tasks.
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-action-metadata-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:
paths:
- ".github/workflows/check-action-metadata-task.ya?ml"
- "action.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
pull_request:
paths:
- ".github/workflows/check-action-metadata-task.ya?ml"
- "action.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-javascript-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Install the [`check-javascript-task.yml`](check-javascript-task.yml) GitHub Acti
- [`.eslintrc.yml`](assets/check-javascript/.eslintrc.yml) - **ESLint** configuration file.
❗ The code style defined in this file is the official standardized style to be used in all Arduino projects and should not be modified.
- Install to: repository root
- [`.npmrc`](assets/npm/.npmrc) - **npm** configuration file.
- Install to: repository root.
- [`Taskfile.yml`](assets/check-javascript-task/Taskfile.yml) - JavaScript linting tasks.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/npm-task/Taskfile.yml) - npm tasks.
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-javascript-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- ".github/workflows/check-javascript-task.ya?ml"
- ".eslintignore"
- "**/.eslintrc*"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand All @@ -18,6 +19,7 @@ on:
- ".github/workflows/check-javascript-task.ya?ml"
- ".eslintignore"
- "**/.eslintrc*"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-markdown-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Install the [`check-markdown-task.yml`](check-markdown-task.yml) GitHub Actions
- Install to: repository root
- [`.markdownlintignore`](assets/check-markdown/.markdownlintignore) - markdownlint configuration file.
- Install to: repository root
- [`.npmrc`](assets/npm/.npmrc) - **npm** configuration file.
- Install to: repository root.
- [`Taskfile.yml`](assets/check-markdown-task/Taskfile.yml) - Markdown tasks.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/npm-task/Taskfile.yml) - npm tasks.
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-markdown-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths:
- ".github/workflows/check-markdown-task.ya?ml"
- ".markdown-link-check.json"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand All @@ -20,6 +21,7 @@ on:
paths:
- ".github/workflows/check-markdown-task.ya?ml"
- ".markdown-link-check.json"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-npm-dependencies-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Install the [`check-npm-dependencies-task.yml`](check-npm-dependencies-task.yml)

### Assets

- [`.npmrc`](assets/npm/.npmrc) - **npm** configuration file.
- Install to: repository root.
- [`Taskfile.yml`](assets/check-dependencies-task/Taskfile.yml) - tasks to cache metadata for and check compatibility of dependency licenses.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/check-npm-dependencies-task/Taskfile.yml) - tasks to check **npm** dependencies.
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-npm-dependencies-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- ".licenses/**"
- ".licensed.json"
- ".licensed.ya?ml"
- ".npmrc"
- "Taskfile.ya?ml"
- "**/.gitmodules"
- "**/package.json"
Expand All @@ -18,6 +19,7 @@ on:
paths:
- ".github/workflows/check-npm-dependencies-task.ya?ml"
- ".licenses/**"
- ".npmrc"
- ".licensed.json"
- ".licensed.ya?ml"
- "Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-npm-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Install the [check-npm-task.yml](check-npm-task.yml) GitHub Actions workflow to

### Assets

- [`.npmrc`](assets/npm/.npmrc) - **npm** configuration file.
- Install to: repository root.
- [`Taskfile.yml`](assets/npm-task/Taskfile.yml) - npm tasks.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/check-npm-task/Taskfile.yml) - Validation task.
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-npm-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
push:
paths:
- ".github/workflows/check-npm-task.ya?ml"
- "**/.npmrc"
- "**/package.json"
- "**/package-lock.json"
- "Taskfile.ya?ml"
pull_request:
paths:
- ".github/workflows/check-npm-task.ya?ml"
- "**/.npmrc"
- "**/package.json"
- "**/package-lock.json"
- "Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-prettier-formatting-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Install the [`check-prettier-formatting-task.yml`](check-prettier-formatting-tas

### Assets

- [`.npmrc`](assets/npm/.npmrc) - **npm** configuration file.
- Install to: repository root.
- [`Taskfile.yml`](assets/check-prettier-formatting-task/Taskfile.yml) - Formatting task.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/npm-task/Taskfile.yml) - npm tasks.
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
paths:
- ".github/workflows/check-prettier-formatting-task.ya?ml"
- ".npmrc"
- "Taskfile.ya?ml"
- "**/.prettierignore"
- "**/.prettierrc*"
Expand Down Expand Up @@ -103,6 +104,7 @@ on:
pull_request:
paths:
- ".github/workflows/check-prettier-formatting-task.ya?ml"
- ".npmrc"
- "Taskfile.ya?ml"
- "**/.prettierignore"
- "**/.prettierrc*"
Expand Down
5 changes: 5 additions & 0 deletions workflow-templates/check-taskfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Validate the repository's [Taskfiles](https://taskfile.dev/#/usage) against the

Install the [`check-taskfiles.yml`](check-taskfiles.yml) GitHub Actions workflow to `.github/workflows/`

### Assets

- [`.npmrc`](assets/npm/.npmrc) - **npm** configuration file.
- Install to: repository root.

### Dependencies

The tool dependencies of this workflow are managed by [npm](https://www.npmjs.com/).
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-taskfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
push:
paths:
- ".github/workflows/check-taskfiles.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "**/Taskfile.ya?ml"
pull_request:
paths:
- ".github/workflows/check-taskfiles.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "**/Taskfile.ya?ml"
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-toc-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Install the [`check-toc-task.yml`](check-toc-task.yml) GitHub Actions workflow t

### Assets

- [`.npmrc`](assets/npm/.npmrc) - **npm** configuration file.
- Install to: repository root.
- [`Taskfile.yml`](assets/check-toc-task/Taskfile.yml) - Table of contents generation task.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/npm-task/Taskfile.yml) - npm tasks.
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-toc-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
push:
paths:
- ".github/workflows/check-toc-task.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
# TODO: Update this if ToC of any other files should be checked.
- "README.md"
pull_request:
paths:
- ".github/workflows/check-toc-task.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
# TODO: Update this if ToC of any other files should be checked.
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-workflows-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Install the [`check-workflows-task.yml`](check-workflows-task.yml) GitHub Action

### Assets

- [`.npmrc`](assets/npm/.npmrc) - **npm** configuration file.
- Install to: repository root.
- [`Taskfile.yml`](assets/check-workflows-task/Taskfile.yml) - workflow validation task.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/npm-task/Taskfile.yml) - npm tasks.
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/check-workflows-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:
push:
paths:
- ".github/workflows/*.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
pull_request:
paths:
- ".github/workflows/*.ya?ml"
- ".npmrc"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
Expand Down
5 changes: 5 additions & 0 deletions workflow-templates/sync-labels-npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ This is the version of the workflow using [npm](https://www.npmjs.com/) for depe

Install the [`sync-labels-npm.yml`](sync-labels-npm.yml) GitHub Actions workflow to `.github/workflows/`

### Assets

- [`.npmrc`](assets/npm/.npmrc) - **npm** configuration file.
- Install to: repository root.

### Dependencies

The tool dependencies of this workflow are managed by [npm](https://www.npmjs.com/).
Expand Down
Loading
Loading