Expose another environment variable for PR builds
See original GitHub issueRTD already exposes the READTHEDOCS
environment variable to provide the option for changed behavior if it is building the docs.
It would be nice to have an additional environment variable, e.g. READTHEDOCS_PR
, that will only be set if the current build was initiated from a PR.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Set environment variables in PR builds of private repos #7413
Default variables behave like Private, but are exposed to “external” builds too if the build privacy level is private (as in Expose project's ......
Read more >How to: Use Environment Variables in a Build - MSBuild
Learn how to access environment variables in MSBuild project files, and use environment variables to set build options without modifying the ...
Read more >Expose GitHub Pull Request link in environment variable
Good idea, just wondering how this should be done, as the PR URL is service dependent, it's different on github, bitbucket, gitlab, …...
Read more >How To Set Jenkins Pipeline Environment Variables?
Jenkins environment variable is a global variable, exposed via env variable and used in Jenkins pipelines and anywhere into Jenkinsfile.
Read more >What Are Environment Variables and How Can I Use Them ...
Probably the most common use case for environment variables is being able to set up different configuration options for different environments.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m 👍🏼 on this. However, the name of the variable may be something like
READTHEDOCS_EXTERNAL_VERSION="True"
to match what we are using in other places --in particular, because GitLab uses MR instead of PR 😞To be honest, that might be something that Github Actions sets.
on_pr()
detects PR builds on both RTD and Github Actions whileon_rtd()
detects RTD. That’s why we use the combination of the two for that extension.