From be85bb39f0440ab01a6b1e0952c9c5f62ed50f34 Mon Sep 17 00:00:00 2001 From: Meghana Jangi Date: Mon, 7 Mar 2022 10:45:50 +0530 Subject: [PATCH] Fixing apidiff prow job failure Signed-off-by: Meghana Jangi --- Makefile | 4 +++- scripts/ci-apidiff.sh | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 7ce7ea196c..88863bcf13 100644 --- a/Makefile +++ b/Makefile @@ -314,9 +314,11 @@ verify-gen: generate ## Verify generated files echo "generated files are out of date, run make generate"; exit 1; \ fi +APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/main) + .PHONY: apidiff apidiff: $(GO_APIDIFF) ## Check for API differences - $(GO_APIDIFF) $(shell git rev-parse origin/main) --print-compatible + $(GO_APIDIFF) $(APIDIFF_OLD_COMMIT) --print-compatible ##@ build: diff --git a/scripts/ci-apidiff.sh b/scripts/ci-apidiff.sh index 1e9e041457..b60a9126c4 100755 --- a/scripts/ci-apidiff.sh +++ b/scripts/ci-apidiff.sh @@ -19,9 +19,8 @@ set -o nounset set -o pipefail REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -APIDIFF="${REPO_ROOT}/hack/tools/bin/go-apidiff" -cd "${REPO_ROOT}" && make apidiff -echo "*** Running go-apidiff ***" +cd "${REPO_ROOT}" -${APIDIFF} "${PULL_BASE_SHA}" --print-compatible +echo "*** Running go-apidiff ***" +APIDIFF_OLD_COMMIT="${PULL_BASE_SHA}" make apidiff