0

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. Perhaps the problem can be solved with the help of a Personal Access Token, job ID or SSL?

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

This solution doesnt work anymore.

before_script:
  - git remote set-url origin https://$GIT_CI_USER:[email protected]/$CI_PROJECT_PATH.git

I tried to set up a PRIVATE ACCESS TOKEN.

before_script:
  - git remote add origin https://username:[email protected]/$CI_PROJECT_PATH.git

Now I get the error message: error: remote origin already exists.

Please take a look at the screenshot enter image description here

1
  • With PATs GitLab doesn't care about the username but does care about the PAT. This post is obscuring the unimportant part while exposing the secret part. Commented Sep 15 at 5:30

1 Answer 1

0

I found the solution.

The right string in the bevore_script is:

before_script:
- git remote set-url origin https://username:[email protected]/$CI_PROJECT_PATH.git

Sign up to request clarification or add additional context in comments.

1 Comment

i dont know its a good idea to post legitimate looking PATs to stackoverflow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.