File tree Expand file tree Collapse file tree 3 files changed +56
-1
lines changed Expand file tree Collapse file tree 3 files changed +56
-1
lines changed Original file line number Diff line number Diff line change @@ -126,3 +126,44 @@ jobs:
126
126
--color \
127
127
--exit-code \
128
128
"${{ matrix.project.path }}/package-lock.json"
129
+
130
+ check-config :
131
+ name : check-config (${{ matrix.project.path }})
132
+ needs : run-determination
133
+ if : needs.run-determination.outputs.result == 'true'
134
+ runs-on : ubuntu-latest
135
+ permissions :
136
+ contents : read
137
+
138
+ strategy :
139
+ fail-fast : false
140
+ matrix :
141
+ project :
142
+ - path : .
143
+
144
+ steps :
145
+ - name : Checkout repository
146
+ uses : actions/checkout@v5
147
+
148
+ - name : Setup Node.js
149
+ uses : actions/setup-node@v4
150
+ with :
151
+ node-version-file : " ${{ matrix.project.path }}/package.json"
152
+
153
+ - name : Install Task
154
+ uses : arduino/setup-task@v2
155
+ with :
156
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
157
+ version : 3.x
158
+
159
+ - name : Fix problems in npm configuration file
160
+ run : |
161
+ task npm:fix-config \
162
+ PROJECT_PATH="${{ matrix.project.path }}"
163
+
164
+ - name : Check if fixes are needed in npm configuration file
165
+ run : |
166
+ git diff \
167
+ --color \
168
+ --exit-code \
169
+ "${{ matrix.project.path }}/.npmrc"
Original file line number Diff line number Diff line change 1
1
# See: https://docs.npmjs.com/cli/configuring-npm/npmrc
2
2
3
- engine-strict = true
3
+ engine-strict = true
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ tasks:
142
142
vars :
143
143
GO_MODULE_PATH : ./ruledocsgen
144
144
- task : markdown:fix
145
+ - task : npm:fix-config
145
146
- task : python:format
146
147
- task : shell:format
147
148
vars :
@@ -477,6 +478,19 @@ tasks:
477
478
markdownlint-cli \
478
479
"**/*.md"
479
480
481
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-npm-task/Taskfile.yml
482
+ npm:fix-config :
483
+ desc : |
484
+ Fix problems with the npm configuration file.
485
+ Environment variable parameters:
486
+ - PROJECT_PATH: Path of the npm-managed project (default: {{.DEFAULT_NPM_PROJECT_PATH}}).
487
+ dir : " {{default .DEFAULT_NPM_PROJECT_PATH .PROJECT_PATH}}"
488
+ cmds :
489
+ - |
490
+ npm config \
491
+ --location project \
492
+ fix
493
+
480
494
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml
481
495
npm:install-deps :
482
496
desc : |
You can’t perform that action at this time.
0 commit comments