diff options
author | 2022-05-29 23:48:31 +0400 | |
---|---|---|
committer | 2022-05-29 23:48:31 +0400 | |
commit | f5c4f7b6f3b10fafd5613a7bec469235443dec24 (patch) | |
tree | 650031817dc86a6db6c559263aacf122552e1540 /docs/conf.py | |
parent | Check Out The Entire Repository For Multiversion (diff) |
Pass Branch Name To Docs In CI
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'docs/conf.py')
-rw-r--r-- | docs/conf.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/docs/conf.py b/docs/conf.py index e4293486..aa9580fe 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -208,11 +208,14 @@ smv_latest_version = "main" smv_branch_whitelist = "main" if os.getenv("BUILD_DOCS_FOR_HEAD", "False").lower() == "true": - try: - branch = git.Repo(PROJECT_ROOT).active_branch.name + if not (branch := os.getenv("BRANCH_NAME")): + try: + branch = git.Repo(PROJECT_ROOT).active_branch.name + except git.InvalidGitRepositoryError: + pass + + if branch: logger.info(f"Adding branch {branch} to build whitelist.") smv_branch_whitelist = f"main|{branch}" - except git.InvalidGitRepositoryError: - pass smv_tag_whitelist = r"v(?!([0-6]\.)|(7\.[0-1]\.0))" # Don't include any versions prior to v7.1.1 |