From 31650a53a1d7f80470d2ba8010966c2cab97eec8 Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Fri, 20 Sep 2024 11:00:34 +0200 Subject: [PATCH] Allow CI could be run on private forked repositories (e.g. new model additions) (#33594) fix Co-authored-by: ydshieh --- .circleci/config.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c03538f07db18..9932156aa969db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,13 +47,13 @@ jobs: - run: name: "Retrieve Artifact Paths" - env: - CIRCLE_TOKEN: ${{ secrets.CI_ARTIFACT_TOKEN }} + # [reference] https://circleci.com/docs/api/v2/index.html#operation/getJobArtifacts + # `CIRCLE_TOKEN` is defined as an environment variables set within a context, see `https://circleci.com/docs/contexts/` command: | project_slug="gh/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" job_number=${CIRCLE_BUILD_NUM} url="https://circleci.com/api/v2/project/${project_slug}/${job_number}/artifacts" - curl -o test_preparation/artifacts.json ${url} + curl -o test_preparation/artifacts.json ${url} --header "Circle-Token: $CIRCLE_TOKEN" - run: name: "Prepare pipeline parameters" command: | @@ -190,7 +190,10 @@ workflows: - check_circleci_user - check_code_quality - check_repository_consistency - - fetch_tests + - fetch_tests: + # [reference] https://circleci.com/docs/contexts/ + context: + - TRANSFORMERS_CONTEXT nightly: when: <>