diff --git a/conf.py b/conf.py index 7b5962b2ce3..32b46f96e83 100644 --- a/conf.py +++ b/conf.py @@ -66,12 +66,15 @@ import re as _re # Detect stable branch version for display purposes. +# In the consolidated deploy DOCS_DISPLAY_VERSION carries the built version (the +# reserved GITHUB_* refs cannot be set per matrix leg). # For PRs: GITHUB_BASE_REF is the target branch (e.g. 'stable33'). # For direct pushes: GITHUB_REF is 'refs/heads/stable33'. _base = os.environ.get('GITHUB_BASE_REF', '') _ref = os.environ.get('GITHUB_REF', '') _stable_ver = ( - _re.match(r'^stable(\d+)$', _base) + _re.match(r'^(\d+)$', os.environ.get('DOCS_DISPLAY_VERSION', '')) + or _re.match(r'^stable(\d+)$', _base) or _re.match(r'^refs/heads/stable(\d+)$', _ref) ) display_version = (