Skip to content

Commit 09c6b36

Browse files
Merge pull request GoogleCloudPlatform#1182 from acpana/acpana/license-lint
chore: add a license-lint gh action
2 parents a76c7fd + ceba0cd commit 09c6b36

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

.github/license-lint-config.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
unrestricted_licenses:
16+
- Apache-2.0
17+
- MIT
18+
- BSD-3-Clause
19+
- BSD-2-Clause
20+
- 0BSD
21+
22+
reciprocal_licenses:
23+
- MPL-2.0
24+
- MPL-2.0-no-copyleft-exception
25+
26+
allowlisted_modules:
27+
# MIT: https://github.com/ghodss/yaml/blob/master/LICENSE
28+
- github.com/ghodss/yaml
29+
# BSD: https://github.com/gogo/protobuf/blob/master/LICENSE
30+
- github.com/gogo/protobuf
31+
# Apache 2.0
32+
- github.com/spf13/cobra
33+
# MIT: https://github.com/kubernetes-sigs/yaml/blob/master/LICENSE
34+
- sigs.k8s.io/yaml
35+
- github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp
36+
# MIT: https://github.com/go-errors/errors/blob/master/LICENSE.MIT
37+
- github.com/go-errors/errors
38+
# Apache 2.0 for repo and third_party is BSD-3-Clause
39+
- github.com/google/pprof
40+
# Apache 2.0: https://github.com/apparentlymart/go-textseg/blob/5b41aa275ccaac4ccaa91729a8ee92e7eac9c728/LICENSE
41+
- github.com/apparentlymart/go-textseg/v13

.github/workflows/license-lint.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: license-lint
16+
on:
17+
push:
18+
paths:
19+
- "go.mod"
20+
- "go.sum"
21+
- "vendor/**" # if we ever use vendor we can target the paths too
22+
pull_request:
23+
paths:
24+
- "go.mod"
25+
- "go.sum"
26+
- "vendor/**" # if we ever use vendor we can target the paths too
27+
jobs:
28+
license-lint:
29+
name: "license-lint"
30+
runs-on: ubuntu-22.04
31+
timeout-minutes: 5
32+
permissions:
33+
contents: read
34+
steps:
35+
- name: Set up Go 1.21
36+
uses: actions/setup-go@v4
37+
with:
38+
go-version: 1.21
39+
- name: Check out code into the Go module directory
40+
uses: actions/checkout@v3
41+
with:
42+
fetch-depth: 0
43+
- name: license-lint
44+
run: |
45+
export GOPATH="$HOME/go"
46+
PATH="$GOPATH/bin:$PATH"
47+
48+
go install istio.io/tools/cmd/[email protected]
49+
50+
license-lint --config ./.github/license-lint-config.yml 2>&1

0 commit comments

Comments
 (0)