Skip to content

Commit

Permalink
build: add license-checker
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin-li committed Nov 20, 2023
1 parent f29794a commit c2b840e
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/licenserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright The Ratify Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

header:
license:
spdx-id: Apache-2.0
content: |
Copyright The Ratify Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
paths-ignore:
- "**/*.{md,svg,yaml,crt,json,pub,yml,pb.go}"
- "CODEOWNERS"
- "PROJECT"
- "NOTICE"
- "LICENSE"
- "MAINTAINERS"
- "go.mod"
- "go.sum"
- "**/testdata/**"
- "charts/**/*"
- ".gitignore"
- ".devcontainer/gatekeeper.http"

comment: on-failure

dependency:
files:
- go.mod
24 changes: 24 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,30 @@ on:
permissions: read-all

jobs:
check-license:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Check license header
uses: apache/skywalking-eyes/header@a790ab8dd23a7f861c18bd6aaa9b012e3a234bce
with:
mode: fix
config: .github/licenserc.yml
- name: Apply Changes
uses: EndBug/add-and-commit@1b561d405c831fe92ec472a6e81647f958824c88
env:
GITHUB_TOKEN: $${{ secrets.GITHUB_TOKEN }}
with:
author_name: License Bot
author_email: [email protected]
message: 'Automatic application of license header'
- name: Check dependencies license
uses: apache/skywalking-eyes/dependency@a790ab8dd23a7f861c18bd6aaa9b012e3a234bce
with:
config: .github/licenserc.yml
flags:
--weak-compatible=true
build:
runs-on: ubuntu-latest
steps:
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright The Ratify Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

BINARY_NAME = ratify
INSTALL_DIR = ~/.ratify
CERT_DIR = ${GITHUB_WORKSPACE}/tls/certs
Expand Down

0 comments on commit c2b840e

Please sign in to comment.