Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions workflow-templates/assets/check-go-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ tasks:
exit 1
fi
- golangci-lint run

go:check-license-headers:
desc: verify presence of license headers and exit with non-zero code if missing
cmds:
- go install github.com/google/addlicense@v1.2.0
- addlicense -check $(find . -name "*.go" -type f -print0 | xargs -0)
27 changes: 27 additions & 0 deletions workflow-templates/check-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,30 @@ jobs:
git diff \
--color \
--exit-code

check-license-headers:
name: check-license-headers (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: ${{ matrix.module.path }}/go.mod

- name: Check license headers
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: go tool task go:check-license-headers
Loading