-
Notifications
You must be signed in to change notification settings - Fork 31.5k
Fix private forked repo. CI #35114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix private forked repo. CI #35114
Conversation
| } | ||
| if "CIRCLE_TOKEN" in os.environ: | ||
| # For private forked repo. (e.g. new model addition) | ||
| config["workflows"] = {"version": 2, "run_tests": {"jobs": [{j.job_name: {"context": ["TRANSFORMERS_CONTEXT"]}} for j in jobs]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The token is defined within a context TRANSFORMERS_CONTEXT (set in CircleCI organization setting)
| "workflows": {"version": 2, "run_tests": {"jobs": [j.job_name for j in jobs]}} | ||
| "jobs" : {j.job_name: j.to_dict() for j in jobs} | ||
| } | ||
| if "CIRCLE_TOKEN" in os.environ: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is available, it means we are in a repo. that is not transformers (i.e. private forked repo.)
It is determined by (in config.yml)
setup_and_quality_2:
when:
not:
equal: [<<pipeline.project.git_url>>, https://github.com/huggingface/transformers]
jobs:
...
- fetch_tests:
# [reference] https://circleci.com/docs/contexts/
context:
- TRANSFORMERS_CONTEXT
|
cc @molbap FYI |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
LysandreJik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top thanks @ydshieh!
What does this PR do?
We need the token
CIRCLE_TOKENto be used in the generated CircleCI config file.