Response is different when executed in Runner and Local
Describe your question in as much detail as possible:
We’re including new pipelines in our private Gitlab runner that requires a request to the API server.
Each request received an empty response from the API server.
Request: curl -Ss --header "PRIVATE-TOKEN: $ACCESS_TOKEN" --request GET "https://$CI_SERVER_HOST/api/v4/projects"
Response: []
Request: curl -Ss --header "PRIVATE-TOKEN: $ACCESS_TOKEN" "https://$CI_SERVER_HOST/api/v4/projects/${CI_PROJECT_ID}/repository/tags"
Response: {"message":"404 Project Not Found"}
But using the same command locally returns the expected response.
The .gitlab-ci.yml looks like this:
pre-merge-checks:
stage: pre-merge-checks
image:
name: dwdraju/alpine-curl-jq:latest
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- echo "Comparing Galaxy version from MR and Master"
- MR_VERSION=$(grep 'version' galaxy.yml | awk '{print $2}')
- 'curl -Ss --header "PRIVATE-TOKEN: $ACCESS_TOKEN" --request GET "https://$CI_SERVER_HOST/api/v4/projects"'
- 'curl -Ss --header "PRIVATE-TOKEN: $ACCESS_TOKEN" "https://$CI_SERVER_HOST/api/v4/projects/${CI_PROJECT_ID}/repository/tags"'
Gitlab server: 15.0.3-ee
GitLab API v4
Gitlab Runner: 15.0.0