Skip to content

Commit bd55359

Browse files
authored
Merge pull request #3368 from meghanajangi/apidiff-restrict
Apidiff test runs only if there are changes in api/ or exp/api/
2 parents b038843 + 8ea7583 commit bd55359

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,9 @@ APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/main)
331331

332332
.PHONY: apidiff
333333
apidiff: $(GO_APIDIFF) ## Check for API differences
334-
$(GO_APIDIFF) $(APIDIFF_OLD_COMMIT) --print-compatible
334+
@if (git --no-pager diff --name-only FETCH_HEAD | grep "api/"); then \
335+
$(GO_APIDIFF) $(APIDIFF_OLD_COMMIT) --print-compatible; \
336+
fi
335337

336338
##@ build:
337339

0 commit comments

Comments
 (0)