0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

ci(go.mod): verify go.mod and go.sum don't have uncommitted changes after go mod tidy (#1287)

This is to avoid situations such as https://github.com/project-zot/zot/pull/1150
where an indirect dependency became direct without a corresponding go.mod change

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
Andrei Aaron 2023-03-21 19:25:13 +02:00 committed by GitHub
parent 21b7c69fd9
commit 4939ca3300
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,10 +36,19 @@ extended-name:=
.PHONY: all
all: modcheck swagger binary binary-minimal binary-debug cli bench exporter-minimal verify-config test covhtml check check-gh-actions
.PHONY: modcheck
modcheck:
.PHONY: modtidy
modtidy:
go mod tidy
.PHONY: modcheck
modcheck: modtidy
$(eval UNCOMMITED_FILES = $(shell git status --porcelain | grep -c 'go.mod\|go.sum'))
@if [ $(UNCOMMITED_FILES) != 0 ]; then \
echo "Updated go.mod and/or go.sum have uncommitted changes, commit the changes accordingly ";\
git status;\
exit 1;\
fi
.PHONY: create-name
create-name:
ifdef EXTENSIONS