Unable to create masked variable because: The value must have 8 characters

I want to set up a Git_CI_USER. I get the message “Unable to create masked variable because: The value must have 8 characters.” My GIT_CI_USER only has 7 characters.

How can I solve this problem? Perhaps the problem can be solved with the help of a job ID or SSL?

Here are a few lines from my .gitlab-ci.yaml file

before_script:
- git remote set-url origin ``https://$GIT_CI_USER:$GIT_CI_PASS@gitlab.com/$CI_PROJECT_PATH.git

The password, not the user, is the secret part.
Most GitLab APIs treat the username as a documentation field and only use the token to authenticate and authorize the access.

Deploy Tokens have a specific user account but other group/personal/project access tokens do not even have a paired username.

1 Like

If you use a project access token for git authentication, then you don’t need a predefined username - you can write any string in there and just pass the project access token for authentication.

e.g. https://ci-bot:$GIT_CI_PASS@gitlab.com/$CI_PROJECT_PATH.git

For this, first create a project access token and then save it as a CI/CD variable, in this case called GIT_CI_PASS.