From 1eb351ccc534fb29ea729d57fa7f280ea3c4d18b Mon Sep 17 00:00:00 2001 From: Teake Nutma <t.a.nutma@rug.nl> Date: Thu, 16 Jun 2022 17:03:34 +0200 Subject: [PATCH] Use a private token for the report diff job The CI job token has limited access to the API; cf. https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html --- templates/testreport/diff.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/testreport/diff.yml b/templates/testreport/diff.yml index f02b1ef..b23b71c 100644 --- a/templates/testreport/diff.yml +++ b/templates/testreport/diff.yml @@ -14,6 +14,7 @@ # as described at https://docs.gitlab.com/ee/api/job_artifacts.html#download-a-single-artifact-file-from-specific-tag-or-branch, # because that only exposes the latest _successful_ pipeline. We want the latest test report # of either the last succeeded pipeline or the last failed pipeline. + - python-gitlab-set-private-token ${TEST_REPORT_JOB_TOKEN} # So, first determine the previous pipeline. - LAST_PIPELINE_SUCCESS=$(gitlab --output json project-pipeline list --project-id $CI_PROJECT_ID --ref $TEST_REPORT_DIFF_REF --scope finished --status success | jq 'first.id') - LAST_PIPELINE_FAILED=$(gitlab --output json project-pipeline list --project-id $CI_PROJECT_ID --ref $TEST_REPORT_DIFF_REF --scope finished --status failed | jq 'first.id') -- GitLab