Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/fix tags docs #173

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import os
import subprocess
import yaml

import re

def git_ref_exists(git_ref: str) -> bool:
"""
Expand All @@ -26,8 +26,14 @@ def git_ref_exists(git_ref: str) -> bool:
Returns:
bool: True if the reference is found, False otherwise.
"""
#check if reference is a tag
tag_pattern = r"^v\d+\.\d+\.\d+$"
if re.match(tag_pattern, git_ref):
refs = "tags"
else:
refs = "heads"
try:
result = subprocess.run(f"git ls-remote --heads origin {git_ref}",
result = subprocess.run(f"git ls-remote --{refs} origin {git_ref}",
shell=True, text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
Expand Down
Loading