I want to clone gitlab repository without prompt for my automation script, by using my private token from my gitlab account.
Can someone provide me a sample?
Inside a GitLab CI pipeline the CI_JOB_TOKEN environment variable works for me:
CI_JOB_TOKEN
git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/...
Source: Gitlab Docs
BTW, setting this variable in .gitlab-ci.yml helps to debug errors.
.gitlab-ci.yml
variables: CI_DEBUG_TRACE: "true"