From 00b1f0a774c1dd1ad8873a950122b2e31d8bbdd2 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Tue, 5 Jan 2021 10:42:26 +0100 Subject: [PATCH] Add a license header check Signed-off-by: Stephen Kitt --- .github/workflows/linting.yml | 10 ++++++++++ .legal.json | 4 ++++ pkg/globalnet/controllers/ipam/node_handler.go | 15 +++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 .legal.json diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index beb73abf7..d9557f961 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -50,6 +50,16 @@ jobs: - name: Run golangci-lint run: make golangci-lint + headers: + name: License Headers + runs-on: ubuntu-latest + steps: + - name: Check out the repository + uses: actions/checkout@v2 + + - name: Check License Headers + uses: nilp0inter/search-legal-headers@v0.1.0 + markdown-link-check: name: Markdown Links (modified files) runs-on: ubuntu-latest diff --git a/.legal.json b/.legal.json new file mode 100644 index 000000000..95021b3f3 --- /dev/null +++ b/.legal.json @@ -0,0 +1,4 @@ +{ + "**/*.go": "Licensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n", + "LICENSE": "Apache License" +} diff --git a/pkg/globalnet/controllers/ipam/node_handler.go b/pkg/globalnet/controllers/ipam/node_handler.go index 36c193567..c01d38338 100644 --- a/pkg/globalnet/controllers/ipam/node_handler.go +++ b/pkg/globalnet/controllers/ipam/node_handler.go @@ -1,3 +1,18 @@ +/* +© 2021 Red Hat, Inc. and others + +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. +*/ package ipam import (