How to configure git global setting to match runner's credentials?

Hello gitlab team!

I’m using self-hosted gitlab and recently started to run into problems when trying to integrate vcpkg (microsoft’s package manager for C++).

  • We got a Windows VM where vcpkg and the windows runner are installed;
  • Private dependencies are projects hosted in our private gitlab instance;
  • Cloning and building the project in the VM works perfectly (vcpkg finds all projects);
  • Cloning and building the project in each developer machine works perfectly (vcpkg finds all projects);
  • Cloning and building the project on the CI fails because vcpkg cannot access the dependencies hosted in gitlab itself;

What I believe is the problem, after some research, is that vcpkg runs git sandboxed. The vcpkg team stated that they get the global git configuration for credentials. What I believe is happening is that the vcpkg cannot get the runner credentials, or that the runner credentials are not set globally. Does it make sense?

Is there a way to configure in the before script to set up git configuration using the runner’s credentials? I try reading the docs about authentication, tokens and all of that. But honestly I dont much experience with it. Any help is welcome.