Skip to content

Commit b7ce834

Browse files
add go license header check in CI
1 parent 1975070 commit b7ce834

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Diff for: .github/workflows/check-go-task.yml

+35
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,41 @@ jobs:
219219
- name: Check whether any tidying was needed
220220
run: git diff --color --exit-code
221221

222+
check-license-headers:
223+
name: check-license-headers (${{ matrix.module.path }})
224+
needs: run-determination
225+
if: needs.run-determination.outputs.result == 'true'
226+
runs-on: ubuntu-latest
227+
228+
strategy:
229+
fail-fast: false
230+
231+
matrix:
232+
module:
233+
- path: ./
234+
235+
steps:
236+
- name: Checkout repository
237+
uses: actions/checkout@v3
238+
239+
- name: Install Go
240+
uses: actions/setup-go@v4
241+
with:
242+
go-version: ${{ env.GO_VERSION }}
243+
244+
- name: Install Task
245+
uses: arduino/setup-task@v1
246+
with:
247+
repo-token: ${{ secrets.GITHUB_TOKEN }}
248+
version: 3.x
249+
250+
- name: Check license headers
251+
env:
252+
GO_MODULE_PATH: ${{ matrix.module.path }}
253+
run: |
254+
task go:check-license-headers
255+
git diff --color --exit-code
256+
222257
# Do a simple "smoke test" build for the modules with no other form of validation
223258
build:
224259
name: build (${{ matrix.module.path }})

0 commit comments

Comments
 (0)