File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -191,9 +191,11 @@ clean-temporary: ## Remove all temporary files and folders.
191
191
clean-release : # # Remove the release folder.
192
192
rm -rf $(RELEASE_DIR )
193
193
194
+ APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/main)
195
+
194
196
.PHONY : apidiff
195
197
apidiff : $(GO_APIDIFF ) # # Check for API differences.
196
- $(GO_APIDIFF ) $(shell git rev-parse origin/main ) --print-compatible
198
+ $(GO_APIDIFF ) $(APIDIFF_OLD_COMMIT ) --print-compatible
197
199
198
200
.PHONY : format-tiltfile
199
201
format-tiltfile : # # Format the Tiltfile.
Original file line number Diff line number Diff line change @@ -20,9 +20,12 @@ set -o pipefail
20
20
21
21
REPO_ROOT=$( dirname " ${BASH_SOURCE[0]} " ) /..
22
22
23
- APIDIFF=" ${REPO_ROOT} /hack/tools/bin/go-apidiff"
24
-
25
- cd " ${REPO_ROOT} " && make " ${APIDIFF##*/ } "
26
- echo " *** Running go-apidiff ***"
27
-
28
- ${APIDIFF} " ${PULL_BASE_SHA} " --print-compatible
23
+ cd " ${REPO_ROOT} "
24
+ APICHANGE=$( git --no-pager diff --name-only FETCH_HEAD)
25
+ if echo " ${APICHANGE} " | grep " /api/"
26
+ then
27
+ echo " *** Running go-apidiff ***"
28
+ APIDIFF_OLD_COMMIT=" ${PULL_BASE_SHA} " make apidiff
29
+ else
30
+ echo " No files under api/ or exp/api/ changed."
31
+ fi
You can’t perform that action at this time.
0 commit comments