From eeb8c4bf706654a173518602d3aea257a88e71c5 Mon Sep 17 00:00:00 2001 From: Chase Qi <chase.qi@linaro.org> Date: Thu, 24 Nov 2022 18:14:35 +0800 Subject: [PATCH] .oniro-ci: call gitlab api with access token The API cannot be called by anonymous now as the CI/CD setting is changed to only visible to project members. Signed-off-by: Chase Qi <chase.qi@linaro.org> --- .oniro-ci/test-generic.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.oniro-ci/test-generic.yaml b/.oniro-ci/test-generic.yaml index ed4ff15b..95f517a1 100644 --- a/.oniro-ci/test-generic.yaml +++ b/.oniro-ci/test-generic.yaml @@ -50,7 +50,10 @@ fi script: # Build callback URL for the "report" job - - curl --silent "$CI_API_V4_URL/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/jobs?per_page=100" > jobs-manual.json + - | + curl --silent \ + --header "PRIVATE-TOKEN: $GITLAB_API_TOKEN" \ + "$CI_API_V4_URL/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/jobs?per_page=100" > jobs-manual.json - job_id="$(jq -r ".[] | select(.name == \"$CI_REPORT_JOB_NAME\") | .id" jobs-manual.json)" - build_job_id="$(jq -r ".[] | select(.name == \"$CI_BUILD_JOB_NAME\") | .id" jobs-manual.json)" - update_job_id="$(jq -r ".[] | select(.name == \"$CI_UPDATE_JOB_NAME\") | .id" jobs-manual.json)" -- GitLab