git

One cause of GitLab built‑in CI runner submodule initialization error

First, the background: a GitLab project that references other projects within the same GitLab instance using submodules. The .gitmodules file looks something like this:

[submodule "lib1"]
	path = lib1
	url = http://gitlab.xxx.xxx/group1/lib1.git
[submodule "lib2"]
	path = lib2
	url = http://gitlab.xxx.xxx/group2/lib2.git
[submodule "lib3"]
	path = lib3
	url = http://gitlab.xxx.xxx/group3/lib3.git

This structure works fine during local development. Of course, the local GitLab account has access permissions to the dependent submodule repositories. When setting up the CI build environment, using GitLab’s docker runner on Linux works without issues. However, on macOS using the shell runner, I encountered errors when initializing submodules:

Continue reading…