I’m trying to fetch information about branches using this command inside a job:
curl -s --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" "$GITLAB_API_URL/projects/$CI_PROJECT_ID/repository/commits/$CI_COMMIT_SHA/refs?type=all"
but it returns: {"message":"401 Unauthorized"}
Why is that? CI_JOB_TOKEN doesn’t have access to the project itself?