Skip to content

Commit cf50b56

Browse files
committed
Add unshallowing repository to CI preflight checks
1 parent f35e146 commit cf50b56

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ clean:
3737
rm -rf ./bin
3838

3939
ci-preflight-checks:
40+
$(MAKE) unshallow-ci-repository
4041
$(MAKE) check-go-mod
4142
$(MAKE) check-dockerfiles
4243
$(MAKE) check-language
@@ -45,6 +46,15 @@ ci-preflight-checks:
4546
$(MAKE) check-ocp-no-crds
4647
$(MAKE) check-dirty
4748

49+
unshallow-ci-repository:
50+
ifdef CI
51+
$(info Running in CI; unshallowing the repository to ensure we have all tags and branches)
52+
git config set remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
53+
git fetch --all --quiet
54+
else
55+
$(info Not running in CI; skipping unshallowing the repository)
56+
endif
57+
4858
check-go-mod:
4959
$(DOCKER_GO_BUILD) ./hack/check-go-mod.sh
5060

0 commit comments

Comments
 (0)