File tree 2 files changed +9
-7
lines changed 2 files changed +9
-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 @@ -19,10 +19,10 @@ set -o nounset
19
19
set -o pipefail
20
20
21
21
REPO_ROOT=$( dirname " ${BASH_SOURCE[0]} " ) /..
22
-
23
- APIDIFF=" ${REPO_ROOT} /hack/tools/bin/go-apidiff"
24
-
25
- cd " ${REPO_ROOT} " && make " ${APIDIFF##*/ } "
22
+ cd " ${REPO_ROOT} "
26
23
echo " *** Running go-apidiff ***"
27
-
28
- ${APIDIFF} " ${PULL_BASE_SHA} " --print-compatible
24
+ APICHANGE=$( git --no-pager diff --name-only FETCH_HEAD | grep " api/" )
25
+ if [[ -n $APICHANGE ]]
26
+ then
27
+ APIDIFF_OLD_COMMIT=" ${PULL_BASE_SHA} " make apidiff
28
+ fi
You can’t perform that action at this time.
0 commit comments