File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -213,9 +213,11 @@ clean-temporary: ## Remove all temporary files and folders.
213213clean-release : # # Remove the release folder.
214214 rm -rf $(RELEASE_DIR )
215215
216+ APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/main)
217+
216218.PHONY : apidiff
217219apidiff : $(GO_APIDIFF ) # # Check for API differences.
218- $(GO_APIDIFF ) $(shell git rev-parse origin/main) --print-compatible
220+ $(GO_APIDIFF ) $(APIDIFF_OLD_COMMIT )
219221
220222.PHONY : format-tiltfile
221223format-tiltfile : # # Format the Tiltfile.
Original file line number Diff line number Diff line change 1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616
17- set -o errexit
1817set -o nounset
1918set -o pipefail
2019
2120REPO_ROOT=$( dirname " ${BASH_SOURCE[0]} " ) /..
2221
23- APIDIFF= " ${REPO_ROOT} /hack/tools/bin/go-apidiff "
22+ cd " ${REPO_ROOT} " || exit
2423
25- make --directory=" ${REPO_ROOT} " " ${APIDIFF##*/ } "
2624echo " *** Running go-apidiff ***"
25+ APIDIFF=$( APIDIFF_OLD_COMMIT=" ${PULL_BASE_SHA} " make apidiff 2> /dev/null)
2726
28- ${APIDIFF} " ${PULL_BASE_SHA} " --print-compatible
27+ if [[ " ${APIDIFF} " == * " sigs.k8s.io/cluster-api-provider-azure/api/" * ]] || [[ " ${APIDIFF} " == * " sigs.k8s.io/cluster-api-provider-azure/exp/api/" * ]]; then
28+ echo " ${APIDIFF} "
29+ exit 1
30+ else
31+ echo " No files under api/ or exp/api/ changed."
32+ fi
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ if [ -z "${GOBIN}" ]; then
3737 exit 1
3838fi
3939
40- rm " ${GOBIN} /${2} " * || true
40+ rm " ${GOBIN} /${2} " * 2> /dev/null || true
4141
4242# install the golang module specified as the first argument
4343go install -tags tools " ${1} @${3} "
You can’t perform that action at this time.
0 commit comments