mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Run license check in CI
This commit is contained in:
3
.github/workflows/go.yml
vendored
3
.github/workflows/go.yml
vendored
@@ -29,6 +29,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
KUSTOMIZE_DOCKER_E2E: false # don't need to do e2e tests for linting
|
KUSTOMIZE_DOCKER_E2E: false # don't need to do e2e tests for linting
|
||||||
|
|
||||||
|
- name: Verify boilerplate
|
||||||
|
run: make check-license
|
||||||
|
|
||||||
test-linux:
|
test-linux:
|
||||||
name: Test Linux
|
name: Test Linux
|
||||||
runs-on: [ubuntu-latest]
|
runs-on: [ubuntu-latest]
|
||||||
|
|||||||
18
Makefile
18
Makefile
@@ -114,18 +114,12 @@ prow-presubmit-check: \
|
|||||||
|
|
||||||
.PHONY: license
|
.PHONY: license
|
||||||
license: $(MYGOBIN)/addlicense
|
license: $(MYGOBIN)/addlicense
|
||||||
$(MYGOBIN)/addlicense \
|
./hack/add-license.sh run
|
||||||
-y 2022 \
|
|
||||||
-c "The Kubernetes Authors." \
|
.PHONY: check-license
|
||||||
-f LICENSE_TEMPLATE \
|
check-license: $(MYGOBIN)/addlicense
|
||||||
-ignore "kyaml/internal/forked/github.com/**/*" \
|
./hack/add-license.sh check
|
||||||
-ignore "site/**/*" \
|
|
||||||
-ignore "**/*.md" \
|
|
||||||
-ignore "**/*.json" \
|
|
||||||
-ignore "**/*.yml" \
|
|
||||||
-ignore "**/*.yaml" \
|
|
||||||
-v \
|
|
||||||
.
|
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: $(MYGOBIN)/golangci-lint $(builtinplugins)
|
lint: $(MYGOBIN)/golangci-lint $(builtinplugins)
|
||||||
|
|||||||
39
hack/add-license.sh
Executable file
39
hack/add-license.sh
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Copyright 2019 The Kubernetes Authors.
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
set -o nounset
|
||||||
|
|
||||||
|
if [[ -z "${1-}" ]] ; then
|
||||||
|
echo "Usage: $0 <mode>"
|
||||||
|
echo "Example: $0 check"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == "check" || $1 == "run" ]]; then
|
||||||
|
mode=$1
|
||||||
|
else
|
||||||
|
echo "Error: mode must be check or run"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
args=(
|
||||||
|
-y 2022
|
||||||
|
-c "The Kubernetes Authors."
|
||||||
|
-f LICENSE_TEMPLATE
|
||||||
|
-ignore "kyaml/internal/forked/github.com/**/*"
|
||||||
|
-ignore "site/**/*"
|
||||||
|
-ignore "**/*.md"
|
||||||
|
-ignore "**/*.json"
|
||||||
|
-ignore "**/*.yml"
|
||||||
|
-ignore "**/*.yaml"
|
||||||
|
-v
|
||||||
|
)
|
||||||
|
if [[ $mode == "check" ]]; then
|
||||||
|
args+=(-check)
|
||||||
|
fi
|
||||||
|
|
||||||
|
addlicense "${args[@]}" .
|
||||||
Reference in New Issue
Block a user