Skip to content

Commit bb5bfd1

Browse files
authored
Merge pull request #6180 from sbueringer/pr-deduplicate-apidiff
🌱 apidiff: deduplicate apidiff logic
2 parents 4c44d05 + 3fee1d5 commit bb5bfd1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,11 @@ lint-fix: $(GOLANGCI_LINT) ## Lint the codebase and run auto-fixers if supported
310310
tiltfile-fix: ## Format the Tiltfile
311311
./hack/verify-starlark.sh fix
312312

313+
APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/main)
314+
313315
.PHONY: apidiff
314316
apidiff: $(GO_APIDIFF) ## Check for API differences
315-
$(GO_APIDIFF) $(shell git rev-parse origin/main) --print-compatible
317+
$(GO_APIDIFF) $(APIDIFF_OLD_COMMIT) --print-compatible
316318

317319
ALL_VERIFY_CHECKS = doctoc boilerplate shellcheck tiltfile modules gen conversions docker-provider book-links
318320

scripts/ci-apidiff.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ set -o pipefail
2020

2121
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
2222

23-
APIDIFF="hack/tools/bin/go-apidiff"
23+
cd "${REPO_ROOT}"
2424

25-
cd "${REPO_ROOT}" && make ${APIDIFF}
2625
echo "*** Running go-apidiff ***"
27-
28-
${APIDIFF} "${PULL_BASE_SHA}" --print-compatible
26+
APIDIFF_OLD_COMMIT="${PULL_BASE_SHA}" make apidiff

0 commit comments

Comments
 (0)