We have a private GitLab repository where I am attempting to reproduce the CI/CD component testing example from the docs. The second step, namely the ensure-job-added
does not pull in the job information and only gives 401 or 404 errors. Concretely, the curl
line does not work:
route="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs"
curl --silent "$route"
{"message":"404 Project Not Found"}
# sometimes also 401
In the documentation, it states that “Authentication is necessary if the project is private.” but I’m not quite sure what that means. Trying any of the following does not yield any success:
curl "$route" --header "PRIVATE-TOKEN: ${CI_JOB_TOKEN}"
curl "$route" --header "Job-Token: $CI_JOB_TOKEN"
Is it not possible to use the CI job token to get job information?