mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
Add govulncheck script to expose go vulnerabilities
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
This commit is contained in:
parent
6c578bc982
commit
190f9d0d4b
29
hack/verify-govulncheck.sh
Executable file
29
hack/verify-govulncheck.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 The Kubernetes 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.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
export WORKDIR=${ARTIFACTS:-$TMPDIR}
|
||||
export PATH=$PATH:$GOPATH/bin
|
||||
mkdir -p "${WORKDIR}"
|
||||
pushd "$WORKDIR"
|
||||
go install golang.org/x/vuln/cmd/govulncheck@v1.0.1
|
||||
popd
|
||||
|
||||
govulncheck -scan module ./... > "${WORKDIR}/head.txt"
|
||||
git reset --hard HEAD
|
||||
git checkout -b base "${PULL_BASE_SHA}"
|
||||
govulncheck -scan module ./... > "${WORKDIR}/pr-base.txt"
|
||||
diff -s -u --ignore-all-space "${WORKDIR}"/pr-base.txt "${WORKDIR}"/head.txt || true
|
Loading…
Reference in New Issue
Block a user