mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
Update hack/verify-govulncheck.sh
Co-authored-by: LX <hwdefcom@outlook.com> Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
This commit is contained in:
parent
190f9d0d4b
commit
9e34aa306c
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Copyright 2022 The Kubernetes Authors.
|
# Copyright 2023 The Kubernetes Authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@ -18,12 +18,12 @@ set -euo pipefail
|
|||||||
export WORKDIR=${ARTIFACTS:-$TMPDIR}
|
export WORKDIR=${ARTIFACTS:-$TMPDIR}
|
||||||
export PATH=$PATH:$GOPATH/bin
|
export PATH=$PATH:$GOPATH/bin
|
||||||
mkdir -p "${WORKDIR}"
|
mkdir -p "${WORKDIR}"
|
||||||
pushd "$WORKDIR"
|
|
||||||
go install golang.org/x/vuln/cmd/govulncheck@v1.0.1
|
go install golang.org/x/vuln/cmd/govulncheck@v1.0.1
|
||||||
popd
|
|
||||||
|
|
||||||
govulncheck -scan module ./... > "${WORKDIR}/head.txt"
|
govulncheck -scan module ./... > "${WORKDIR}/head.txt"
|
||||||
|
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
git checkout -b base "${PULL_BASE_SHA}"
|
git checkout -b base "${PULL_BASE_SHA}"
|
||||||
govulncheck -scan module ./... > "${WORKDIR}/pr-base.txt"
|
govulncheck -scan module ./... > "${WORKDIR}/pr-base.txt"
|
||||||
|
|
||||||
diff -s -u --ignore-all-space "${WORKDIR}"/pr-base.txt "${WORKDIR}"/head.txt || true
|
diff -s -u --ignore-all-space "${WORKDIR}"/pr-base.txt "${WORKDIR}"/head.txt || true
|
||||||
|
Loading…
Reference in New Issue
Block a user