File tree 1 file changed +2
-12
lines changed
1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -51,23 +51,14 @@ packages_flagged=()
51
51
packages_url_missing=()
52
52
exit_code=0
53
53
54
- git remote add licenses https://github.com/kubernetes/kubernetes > /dev/null 2>&1 || true
55
-
56
-
57
54
# Install go-licenses
58
55
echo ' [INFO] Installing go-licenses...'
59
- pushd " ${KUBE_TEMP} " > /dev/null
60
- git clone https://github.com/google/go-licenses.git > /dev/null 2>&1
61
- cd go-licenses
62
- go build -o " ${GOPATH} /bin"
63
- popd > /dev/null
64
-
56
+ go install github.com/google/go-licenses@latest
65
57
66
58
# Fetching CNCF Approved List Of Licenses
67
59
# Refer: https://github.com/cncf/foundation/blob/main/allowed-third-party-license-policy.md
68
60
curl -s ' https://spdx.org/licenses/licenses.json' -o " ${KUBE_TEMP} " /licenses.json
69
61
70
-
71
62
number_of_licenses=$( jq ' .licenses | length' " ${KUBE_TEMP} " /licenses.json)
72
63
loop_index_length=$(( number_of_licenses - 1 ))
73
64
85
76
86
77
# Scanning go-packages under the project & verifying against the CNCF approved list of licenses
87
78
echo ' [INFO] Starting license scan on go-packages...'
88
- go-licenses csv --git_remote licenses ./... >> " ${KUBE_TEMP} " /licenses.csv 2> /dev/null
89
-
79
+ go-licenses report ./... >> " ${KUBE_TEMP} " /licenses.csv
90
80
91
81
echo -e ' PACKAGE_NAME LICENSE_NAME LICENSE_URL\n' >> " ${KUBE_TEMP} " /approved_licenses.dump
92
82
while IFS=, read -r GO_PACKAGE LICENSE_URL LICENSE_NAME
You can’t perform that action at this time.
0 commit comments