We want to know if it's technically possible like in GitHub, to do a git push using https protocol and not ssh and without using directly an username and password in the curl request.
I have seen people that seem to think it is possible, we weren't able to prove it.
Is there any proof or witness out there than can confirm such a feature that allow you to push using a user access token or the gitlab-ci-token within the CI?
I am giving my
before_script.shthat can be used within any.gitlab-ci.ymlAll you need is to set a protected environment variable called
GL_TOKENorGITLAB_TOKENwithin your project.It doesn't require to change the default git strategy and it will work fine with non protected branch using the default
gitlab-ci-token.On a protected branch, you can use the
git pushcommand as usual.We stopped using SSH keys, Vít Kotačka answers helped us understand why it was failing before.