CI_JOB_TOKEN should allow git clone with non-specific username

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Proposal

When using a personal access token (PAT) to perform git clone, we state that the username:

  • Can be any string value
  • Must not be an empty string

However, when using a CI_JOB_TOKEN, it is only possible to clone successfully when the username is set to gitlab_ci_token.

It's not clear if this is by design but not being able to use a value other than gitlab_ci_token when performing git clone does lead to issues.

For example when using Docker buildkit secrets to perform an ADD of a repository (see Git authentication for remote contexts) in the build via GIT_AUTH_TOKEN. Docker buildkit appears a little quirky in that it currently injects the username x-access-token to perform the git clone and thus cannot be used with a CI_JOB_TOKEN.

It would be ideal to match the functionality with regard to git operations by CI_JOB_TOKEN to that of a PAT, in that any arbitrary username can be used.

Edited by 🤖 GitLab Bot 🤖