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:
117
117
118
118
- name : Check package-lock.json
119
119
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 49
49
- task : github:sync
50
50
- task : js:fix
51
51
- task : markdown:fix
52
+ - task : npm:fix-config
52
53
- task : python:format
53
54
- task : shell:format
54
55
vars :
@@ -730,6 +731,21 @@ tasks:
730
731
cmds :
731
732
- npm install
732
733
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
+
733
749
# Parameter variables:
734
750
# - PROJECT_PATH: path of the npm-managed project. Default value: "./"
735
751
# 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 2
2
version : " 3"
3
3
4
4
tasks :
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
+
5
20
# Parameter variables:
6
21
# - PROJECT_PATH: path of the npm-managed project. Default value: "./"
7
22
# 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:
117
117
118
118
- name : Check package-lock.json
119
119
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