Skip to content

Commit 4397fac

Browse files
committed
Validate license header on files on CI
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
1 parent bd32f8c commit 4397fac

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ jobs:
7171
- name: Run Staticcheck
7272
run: make staticcheck
7373

74+
- name: Check License headers
75+
run: |
76+
GO111MODULE=off go get github.com/google/addlicense
77+
78+
addlicense -check $(find . -type f -name "*.go")
79+
addlicense -check $(find . -type f -name "*.sh")
80+
addlicense -check $(find . -type f -name "Dockerfile")
81+
7482
- name: Check docs
7583
if: "!contains(github.ref, 'refs/heads/master')"
7684
run: make docs && test -z "$(git status --porcelain)" || exit 1

internal/cli/run_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*
2+
Copyright 2021 The terraform-docs Authors.
3+
4+
Licensed under the MIT license (the "License"); you may not
5+
use this file except in compliance with the License.
6+
7+
You may obtain a copy of the License at the LICENSE file in
8+
the root directory of this source tree.
9+
*/
10+
111
package cli
212

313
import (

internal/plugin/discovery.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*
2+
Copyright 2021 The terraform-docs Authors.
3+
4+
Licensed under the MIT license (the "License"); you may not
5+
use this file except in compliance with the License.
6+
7+
You may obtain a copy of the License at the LICENSE file in
8+
the root directory of this source tree.
9+
*/
10+
111
package plugin
212

313
import (

internal/plugin/plugin.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*
2+
Copyright 2021 The terraform-docs Authors.
3+
4+
Licensed under the MIT license (the "License"); you may not
5+
use this file except in compliance with the License.
6+
7+
You may obtain a copy of the License at the LICENSE file in
8+
the root directory of this source tree.
9+
*/
10+
111
package plugin
212

313
import (

0 commit comments

Comments
 (0)