Allow CI could be run on private forked repositories (e.g. new model additions) (#33594)

fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar 2024-09-20 11:00:34 +02:00 committed by GitHub
parent 6dc364616d
commit 31650a53a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,13 +47,13 @@ jobs:
- run: - run:
name: "Retrieve Artifact Paths" name: "Retrieve Artifact Paths"
env: # [reference] https://circleci.com/docs/api/v2/index.html#operation/getJobArtifacts
CIRCLE_TOKEN: ${{ secrets.CI_ARTIFACT_TOKEN }} # `CIRCLE_TOKEN` is defined as an environment variables set within a context, see `https://circleci.com/docs/contexts/`
command: | command: |
project_slug="gh/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" project_slug="gh/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
job_number=${CIRCLE_BUILD_NUM} job_number=${CIRCLE_BUILD_NUM}
url="https://circleci.com/api/v2/project/${project_slug}/${job_number}/artifacts" 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: - run:
name: "Prepare pipeline parameters" name: "Prepare pipeline parameters"
command: | command: |
@ -190,7 +190,10 @@ workflows:
- check_circleci_user - check_circleci_user
- check_code_quality - check_code_quality
- check_repository_consistency - check_repository_consistency
- fetch_tests - fetch_tests:
# [reference] https://circleci.com/docs/contexts/
context:
- TRANSFORMERS_CONTEXT
nightly: nightly:
when: <<pipeline.parameters.nightly>> when: <<pipeline.parameters.nightly>>