question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose another environment variable for PR builds

See original GitHub issue

RTD 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:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
humitoscommented, Sep 6, 2021

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 😞

2reactions
TheTripleVcommented, Jan 24, 2022

To be honest, that might be something that Github Actions sets. on_pr() detects PR builds on both RTD and Github Actions while on_rtd() detects RTD. That’s why we use the combination of the two for that extension.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found