diff --git a/.github/workflows/check-action-metadata-task.yml b/.github/workflows/check-action-metadata-task.yml index 4a25a4d3..977538cc 100644 --- a/.github/workflows/check-action-metadata-task.yml +++ b/.github/workflows/check-action-metadata-task.yml @@ -1,14 +1,11 @@ name: Check Action Metadata -env: - # See: https://github.com/actions/setup-node/#readme - NODE_VERSION: 20.x - # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows on: push: paths: - ".github/workflows/check-action-metadata-task.ya?ml" + - ".npmrc" - "action.ya?ml" - "package.json" - "package-lock.json" @@ -16,6 +13,7 @@ on: pull_request: paths: - ".github/workflows/check-action-metadata-task.ya?ml" + - ".npmrc" - "action.ya?ml" - "package.json" - "package-lock.json" @@ -37,7 +35,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 diff --git a/.github/workflows/check-markdown-task.yml b/.github/workflows/check-markdown-task.yml index 835ea8eb..c1d0f87b 100644 --- a/.github/workflows/check-markdown-task.yml +++ b/.github/workflows/check-markdown-task.yml @@ -1,16 +1,13 @@ # 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/en/actions/reference/events-that-trigger-workflows on: push: paths: - ".github/workflows/check-markdown-task.ya?ml" - ".markdown-link-check.json" + - ".npmrc" - "package.json" - "package-lock.json" - "Taskfile.ya?ml" @@ -23,6 +20,7 @@ on: paths: - ".github/workflows/check-markdown-task.ya?ml" - ".markdown-link-check.json" + - ".npmrc" - "package.json" - "package-lock.json" - "Taskfile.ya?ml" @@ -48,7 +46,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 @@ -72,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: Install Task uses: arduino/setup-task@v2 diff --git a/.github/workflows/check-npm-dependencies-task.yml b/.github/workflows/check-npm-dependencies-task.yml index 10336c21..9edf0fe7 100644 --- a/.github/workflows/check-npm-dependencies-task.yml +++ b/.github/workflows/check-npm-dependencies-task.yml @@ -1,10 +1,6 @@ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-npm-dependencies-task.md name: Check npm Dependencies -env: - # See: https://github.com/actions/setup-node/#readme - NODE_VERSION: 20.x - # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows on: create: @@ -16,6 +12,7 @@ on: - ".licensed.ya?ml" - "Taskfile.ya?ml" - "**/.gitmodules" + - "**/.npmrc" - "**/package.json" - "**/package-lock.json" pull_request: @@ -26,6 +23,7 @@ on: - ".licensed.ya?ml" - "Taskfile.ya?ml" - "**/.gitmodules" + - "**/.npmrc" - "**/package.json" - "**/package-lock.json" schedule: @@ -78,7 +76,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 @@ -128,7 +126,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 diff --git a/.github/workflows/check-npm-task.yml b/.github/workflows/check-npm-task.yml index 344f69b9..0d1e7991 100644 --- a/.github/workflows/check-npm-task.yml +++ b/.github/workflows/check-npm-task.yml @@ -1,21 +1,19 @@ # 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/en/actions/reference/events-that-trigger-workflows 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" @@ -39,7 +37,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 @@ -60,7 +58,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 diff --git a/.github/workflows/check-prettier-formatting-task.yml b/.github/workflows/check-prettier-formatting-task.yml index 88edee61..467871f3 100644 --- a/.github/workflows/check-prettier-formatting-task.yml +++ b/.github/workflows/check-prettier-formatting-task.yml @@ -1,16 +1,13 @@ # 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: 20.x - # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: push: paths: - ".github/workflows/check-prettier-formatting-task.ya?ml" - "Taskfile.ya?ml" + - "**/.npmrc" - "**/.prettierignore" - "**/.prettierrc*" # CSS @@ -107,6 +104,7 @@ on: paths: - ".github/workflows/check-prettier-formatting-task.ya?ml" - "Taskfile.ya?ml" + - "**/.npmrc" - "**/.prettierignore" - "**/.prettierrc*" # CSS @@ -213,7 +211,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 diff --git a/.github/workflows/check-tsconfig-task.yml b/.github/workflows/check-tsconfig-task.yml index 8404e48a..6936611c 100644 --- a/.github/workflows/check-tsconfig-task.yml +++ b/.github/workflows/check-tsconfig-task.yml @@ -1,15 +1,12 @@ name: Check TypeScript Configuration -env: - # See: https://github.com/actions/setup-node/#readme - NODE_VERSION: 16.x - # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows on: push: paths: - ".github/workflows/check-tsconfig-task.ya?ml" - "**/tsconfig*.json" + - ".npmrc" - "package.json" - "package-lock.json" - "Taskfile.ya?ml" @@ -17,6 +14,7 @@ on: paths: - ".github/workflows/check-tsconfig-task.ya?ml" - "**/tsconfig*.json" + - ".npmrc" - "package.json" - "package-lock.json" - "Taskfile.ya?ml" @@ -45,7 +43,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 diff --git a/.github/workflows/check-typescript-task.yml b/.github/workflows/check-typescript-task.yml index ec606822..bc8f9f63 100644 --- a/.github/workflows/check-typescript-task.yml +++ b/.github/workflows/check-typescript-task.yml @@ -1,9 +1,5 @@ name: Check TypeScript -env: - # See: https://github.com/actions/setup-node/#readme - NODE_VERSION: 20.x - # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows on: push: @@ -11,6 +7,7 @@ on: - ".github/workflows/check-typescript-task.ya?ml" - ".eslintignore" - "**/.eslintrc*" + - ".npmrc" - "package.json" - "package-lock.json" - "Taskfile.ya?ml" @@ -25,6 +22,7 @@ on: - ".github/workflows/check-typescript-task.ya?ml" - ".eslintignore" - "**/.eslintrc*" + - ".npmrc" - "package.json" - "package-lock.json" - "Taskfile.ya?ml" @@ -51,7 +49,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 diff --git a/.github/workflows/sync-labels-npm.yml b/.github/workflows/sync-labels-npm.yml index 458a7aa8..b201f3f3 100644 --- a/.github/workflows/sync-labels-npm.yml +++ b/.github/workflows/sync-labels-npm.yml @@ -2,8 +2,6 @@ name: Sync Labels env: - # See: https://github.com/actions/setup-node/#readme - NODE_VERSION: 16.x CONFIGURATIONS_FOLDER: .github/label-configuration-files CONFIGURATIONS_ARTIFACT: label-configuration-files @@ -13,12 +11,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: @@ -38,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 @@ -132,7 +132,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: | diff --git a/.github/workflows/test-typescript-task.yml b/.github/workflows/test-typescript-task.yml index be512728..8950da2f 100644 --- a/.github/workflows/test-typescript-task.yml +++ b/.github/workflows/test-typescript-task.yml @@ -1,13 +1,10 @@ name: Test TypeScript -env: - # See: https://github.com/actions/setup-node/#readme - NODE_VERSION: 20.x - on: push: paths: - ".github/workflows/test-typescript-task.ya?ml" + - ".npmrc" - "jest.config.js" - "package.json" - "package-lock.json" @@ -21,6 +18,7 @@ on: pull_request: paths: - ".github/workflows/test-typescript-task.ya?ml" + - ".npmrc" - "jest.config.js" - "package.json" - "package-lock.json" @@ -54,7 +52,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 @@ -75,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: Install Task uses: arduino/setup-task@v2 diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..2fc27b7e --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +# See: https://docs.npmjs.com/cli/configuring-npm/npmrc + +engine-strict = true diff --git a/package-lock.json b/package-lock.json index 2e08a549..444a166c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,9 @@ "strip-json-comments-cli": "^3.0.0", "ts-jest": "^28.0.8", "typescript": "^5.5.4" + }, + "engines": { + "node": "20.x" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 0240f39a..7804b86e 100644 --- a/package.json +++ b/package.json @@ -46,5 +46,8 @@ "strip-json-comments-cli": "^3.0.0", "ts-jest": "^28.0.8", "typescript": "^5.5.4" + }, + "engines": { + "node": "20.x" } }