Skip to content

Commit c532ab2

Browse files
committed
fix: Set GOBIN environment variable for apidiff installation
1 parent 23d89dc commit c532ab2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hack/apidiff.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,19 @@ fi
5555

5656
# Check for apidiff tool, install it if not found
5757
if ! command -v "${API_DIFF_TOOL}" &> /dev/null; then
58+
GOBIN=${GOBIN:-$(go env GOPATH)/bin}
5859
echo "Installing apidiff into ${GOBIN}."
5960
go install golang.org/x/exp/cmd/apidiff@latest
6061
fi
6162

63+
# Ensure the remote is set
64+
if ! git remote get-url origin &> /dev/null; then
65+
git remote add origin https://github.com/kubernetes-sigs/structured-merge-diff.git
66+
fi
67+
68+
# Fetch the latest changes from the remote
69+
git fetch origin
70+
6271
# Fetch common base if -r is not set
6372
if [ -z "${REFERENCE_REVISION}" ]; then
6473
echo "Determining common base with origin/master..."

0 commit comments

Comments
 (0)