diff --git a/tooling/docs-autogen/generate-ast.py b/tooling/docs-autogen/generate-ast.py index 56877dcfb..98068af18 100644 --- a/tooling/docs-autogen/generate-ast.py +++ b/tooling/docs-autogen/generate-ast.py @@ -64,7 +64,11 @@ def normalize_version(v: str | None) -> str | None: if not v: return None - return v[1:] if v.startswith("v") else v + v = v[1:] if v.startswith("v") else v + # Return None for branch names or non-version strings (must start with digit) + if not v or not v[0].isdigit(): + return None + return v def yaml_quote(value: str | None) -> str: