Skip to content

Commit 57572e3

Browse files
committed
Fix git ref calculation
1 parent 939677a commit 57572e3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@
4040
# -- Detect version ----------------------------------------------------------
4141

4242
nuget_version_regex = re.compile(r'(?:\.?[0-9]+){3,}(?:[-a-z]+)?')
43-
rtd_version = os.environ.get('READTHEDOCS_GIT_IDENTIFIER') or 'main'
43+
from sphinx_gha.git_ref import get_git_ref
44+
git_ref = get_git_ref(sphinx_gha_repo_root)
4445

4546
jinja_globals = {
46-
'git_ref': rtd_version,
47-
'nuget_version': rtd_version if nuget_version_regex.match(rtd_version) else None,
47+
'git_ref': git_ref,
48+
'nuget_version': git_ref if nuget_version_regex.match(git_ref) else None,
4849
}

0 commit comments

Comments
 (0)