File tree Expand file tree Collapse file tree 4 files changed +119
-0
lines changed Expand file tree Collapse file tree 4 files changed +119
-0
lines changed Original file line number Diff line number Diff line change @@ -117,3 +117,47 @@ jobs:
117117
118118 - name : Check package-lock.json
119119 run : git diff --color --exit-code "${{ matrix.project.path }}/package-lock.json"
120+
121+ check-config :
122+ name : check-config (${{ matrix.project.path }})
123+ needs : run-determination
124+ if : needs.run-determination.outputs.result == 'true'
125+ runs-on : ubuntu-latest
126+ permissions :
127+ contents : read
128+
129+ strategy :
130+ fail-fast : false
131+ matrix :
132+ project :
133+ # TODO: add paths of all npm-managed projects in the repository here.
134+ - path : .
135+
136+ steps :
137+ - name : Checkout repository
138+ uses : actions/checkout@v4
139+
140+ - name : Setup Node.js
141+ uses : actions/setup-node@v4
142+ with :
143+ node-version-file : " ${{ matrix.project.path }}/package.json"
144+
145+ - name : Install Task
146+ uses : arduino/setup-task@v2
147+ with :
148+ repo-token : ${{ secrets.GITHUB_TOKEN }}
149+ version : 3.x
150+
151+ - name : Fix problems in npm configuration file
152+ run : |
153+ task \
154+ npm:fix-config \
155+ PROJECT_PATH="${{ matrix.project.path }}"
156+
157+ - name : Check if fixes are needed in npm configuration file
158+ run : |
159+ git \
160+ diff \
161+ --color \
162+ --exit-code \
163+ "${{ matrix.project.path }}/.npmrc"
Original file line number Diff line number Diff line change 4949 - task : github:sync
5050 - task : js:fix
5151 - task : markdown:fix
52+ - task : npm:fix-config
5253 - task : python:format
5354 - task : shell:format
5455 vars :
@@ -730,6 +731,21 @@ tasks:
730731 cmds :
731732 - npm install
732733
734+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-npm-task/Taskfile.yml
735+ npm:fix-config :
736+ desc : |
737+ Fix problems with the npm configuration file.
738+ Environment variable parameters:
739+ - PROJECT_PATH: Path of the npm-managed project (default: {{.DEFAULT_NPM_PROJECT_PATH}}).
740+ dir : |
741+ "{{default "./" .PROJECT_PATH}}"
742+ cmds :
743+ - |
744+ npm \
745+ config \
746+ --location project \
747+ fix
748+
733749 # Parameter variables:
734750 # - PROJECT_PATH: path of the npm-managed project. Default value: "./"
735751 # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-npm-task/Taskfile.yml
Original file line number Diff line number Diff line change 22version : " 3"
33
44tasks :
5+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-npm-task/Taskfile.yml
6+ npm:fix-config :
7+ desc : |
8+ Fix problems with the npm configuration file.
9+ Environment variable parameters:
10+ - PROJECT_PATH: Path of the npm-managed project (default: ./).
11+ dir : |
12+ "{{default "./" .PROJECT_PATH}}"
13+ cmds :
14+ - |
15+ npm \
16+ config \
17+ --location project \
18+ fix
19+
520 # Parameter variables:
621 # - PROJECT_PATH: path of the npm-managed project. Default value: "./"
722 # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-npm-task/Taskfile.yml
Original file line number Diff line number Diff line change @@ -117,3 +117,47 @@ jobs:
117117
118118 - name : Check package-lock.json
119119 run : git diff --color --exit-code "${{ matrix.project.path }}/package-lock.json"
120+
121+ check-config :
122+ name : check-config (${{ matrix.project.path }})
123+ needs : run-determination
124+ if : needs.run-determination.outputs.result == 'true'
125+ runs-on : ubuntu-latest
126+ permissions :
127+ contents : read
128+
129+ strategy :
130+ fail-fast : false
131+ matrix :
132+ project :
133+ # TODO: add paths of all npm-managed projects in the repository here.
134+ - path : .
135+
136+ steps :
137+ - name : Checkout repository
138+ uses : actions/checkout@v4
139+
140+ - name : Setup Node.js
141+ uses : actions/setup-node@v4
142+ with :
143+ node-version-file : " ${{ matrix.project.path }}/package.json"
144+
145+ - name : Install Task
146+ uses : arduino/setup-task@v2
147+ with :
148+ repo-token : ${{ secrets.GITHUB_TOKEN }}
149+ version : 3.x
150+
151+ - name : Fix problems in npm configuration file
152+ run : |
153+ task \
154+ npm:fix-config \
155+ PROJECT_PATH="${{ matrix.project.path }}"
156+
157+ - name : Check if fixes are needed in npm configuration file
158+ run : |
159+ git \
160+ diff \
161+ --color \
162+ --exit-code \
163+ "${{ matrix.project.path }}/.npmrc"
You can’t perform that action at this time.
0 commit comments