"vscode:/vscode.git/clone" did not exist on "e1224a2a0f42c2d00f5b9d93d4d5dd43a628b574"
Unverified Commit 8f09dd89 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Avoid CI runs under users' own CircleCI personal account (#20981)



* Avoid null CI

* Avoid null CI

* rename

* more clear error message

* Update .circleci/config.yml
Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>

* clean up
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
parent 7b0727a4
......@@ -9,6 +9,19 @@ parameters:
default: false
jobs:
# Ensure running with CircleCI/huggingface
check_circleci_user:
docker:
- image: cimg/python:3.7.12
parallelism: 1
steps:
- run: echo $CIRCLE_PROJECT_USERNAME
- run: |
if [ "$CIRCLE_PROJECT_USERNAME" = "huggingface" ]; then
exit 0
else
echo "The CI is running under $CIRCLE_PROJECT_USERNAME personal account. Please follow https://support.circleci.com/hc/en-us/articles/360008097173-Troubleshooting-why-pull-requests-are-not-triggering-jobs-on-my-organization- to fix it."; exit -1
fi
# Fetch the tests to run
fetch_tests:
working_directory: ~/transformers
......@@ -171,6 +184,7 @@ workflows:
when:
not: <<pipeline.parameters.nightly>>
jobs:
- check_circleci_user
- check_code_quality
- check_repository_consistency
- fetch_tests
......@@ -178,6 +192,7 @@ workflows:
nightly:
when: <<pipeline.parameters.nightly>>
jobs:
- check_circleci_user
- check_code_quality
- check_repository_consistency
- fetch_all_tests
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment