"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "4354005291dacd5c8264f0936a33678df4f4bb71"
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: ...@@ -9,6 +9,19 @@ parameters:
default: false default: false
jobs: 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 the tests to run
fetch_tests: fetch_tests:
working_directory: ~/transformers working_directory: ~/transformers
...@@ -171,6 +184,7 @@ workflows: ...@@ -171,6 +184,7 @@ workflows:
when: when:
not: <<pipeline.parameters.nightly>> not: <<pipeline.parameters.nightly>>
jobs: jobs:
- check_circleci_user
- check_code_quality - check_code_quality
- check_repository_consistency - check_repository_consistency
- fetch_tests - fetch_tests
...@@ -178,6 +192,7 @@ workflows: ...@@ -178,6 +192,7 @@ workflows:
nightly: nightly:
when: <<pipeline.parameters.nightly>> when: <<pipeline.parameters.nightly>>
jobs: jobs:
- check_circleci_user
- check_code_quality - check_code_quality
- check_repository_consistency - check_repository_consistency
- fetch_all_tests - 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