In complex CI/CD scenarios, we may need to access other resources from GitLab that is out of current project/repository, like cloning another repository, or calling gitlab API to trigger a contiguous job.

These resources are accessible via CI/CD job token.

Clone a Repository Using CI_JOB_TOKEN

git clone https://gitlab-ci-token:${CI_JOB_TOKEN}<namespace>/<project>

Trigger a Job Using CI_JOB_TOKEN

curl --request POST --form token=${CI_JOB_TOKEN}<project_id>/trigger/pipeline