diff --git a/.github/licenserc.yml b/.github/licenserc.yml new file mode 100644 index 00000000..fa7c88c3 --- /dev/null +++ b/.github/licenserc.yml @@ -0,0 +1,42 @@ +# Copyright The ORAS 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 ORAS 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' + - 'LICENSE' + - 'go.mod' + - 'go.sum' + - '**/testdata/**' + + comment: on-failure + +dependency: + files: + - go.mod diff --git a/.github/workflows/license-checker.yml b/.github/workflows/license-checker.yml new file mode 100644 index 00000000..cc91c47a --- /dev/null +++ b/.github/workflows/license-checker.yml @@ -0,0 +1,40 @@ +# Copyright The ORAS 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. + +name: License Checker + +on: + push: + branches: main + pull_request: + branches: main + +permissions: + contents: write + pull-requests: write + +jobs: + check-license: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Check license header + uses: apache/skywalking-eyes/header@v0.4.0 + with: + mode: check + config: .github/licenserc.yml + - name: Check dependencies license + uses: apache/skywalking-eyes/dependency@v0.4.0 + with: + config: .github/licenserc.yml diff --git a/.gitignore b/.gitignore index 3e142af8..88abf647 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,16 @@ +# Copyright The ORAS 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. + # Binaries for programs and plugins *.exe *.exe~ diff --git a/Makefile b/Makefile index 9809511f..bc671e44 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,16 @@ +# Copyright The ORAS 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. + .PHONY: test test: vendor check-encoding go test -race -v -coverprofile=coverage.txt -covermode=atomic ./...