File tree 2 files changed +42
-0
lines changed
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -37,3 +37,10 @@ tasks:
37
37
dir : " {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
38
38
cmds :
39
39
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
40
+
41
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
42
+ go:check-license-headers :
43
+ desc : Check go license headers
44
+ cmds :
45
+ - go install github.com/google/addlicense@v1.1.1
46
+ - addlicense -c "ARDUINO SA (http://www.arduino.cc/)" -f ./license_header.tpl *.go
Original file line number Diff line number Diff line change @@ -226,3 +226,38 @@ jobs:
226
226
227
227
- name : Check whether any tidying was needed
228
228
run : git diff --color --exit-code
229
+
230
+ check-license-headers :
231
+ name : check-license-headers (${{ matrix.module.path }})
232
+ needs : run-determination
233
+ if : needs.run-determination.outputs.result == 'true'
234
+ runs-on : ubuntu-latest
235
+
236
+ strategy :
237
+ fail-fast : false
238
+
239
+ matrix :
240
+ module :
241
+ - path : ./
242
+
243
+ steps :
244
+ - name : Checkout repository
245
+ uses : actions/checkout@v3
246
+
247
+ - name : Install Go
248
+ uses : actions/setup-go@v4
249
+ with :
250
+ go-version : ${{ env.GO_VERSION }}
251
+
252
+ - name : Install Task
253
+ uses : arduino/setup-task@v1
254
+ with :
255
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
256
+ version : 3.x
257
+
258
+ - name : Check license headers
259
+ env :
260
+ GO_MODULE_PATH : ${{ matrix.module.path }}
261
+ run : |
262
+ task go:check-license-headers
263
+ git diff --color --exit-code
You can’t perform that action at this time.
0 commit comments