Skip to content

Commit 647b6f4

Browse files
committed
fix: update apidiff script to install tool and set up remote repository
1 parent 23d89dc commit 647b6f4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: hack/apidiff.sh

+11
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,21 @@ 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
61+
# Add GOBIN to PATH
62+
export PATH=$PATH:${GOBIN}
6063
fi
6164

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

0 commit comments

Comments
 (0)