I am trying to push the tag in tagging stage of pipeline, I have a logic to form a tag and push it back to repo. Now to push the tag, I've created project access token and have below in my gitlab yml. The output is with "set -x"
$ git push "${TEST_TAG}" "${CI_REPOSITORY_URL}"
++ git push v1.0.0 https://gitlab-ci-token:[MASKED]@gitlab.demo.com/demouser/demoproject.git
error: src refspec https://gitlab-ci-token does not match any
queries:
- this is because I haven't set the variable with access token value in gitlab yml? also if I do so, doesn't it expose the token?
- what am I missing here?
Also, what would be the best practice as of 2022 to do so. Thanks.