Skip to content

Commit b30710e

Browse files
authored
Merge pull request #2879 from manics/docs-fix-gitref
docs: fix git sha lookup for dev builds
2 parents 9a7d03d + 283f150 commit b30710e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/source/conf.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ def setup(app):
3737
def _get_git_ref_from_chartpress_based_version(version):
3838
"""
3939
Get a git ref from a chartpress set version of format like
40-
1.2.3-beta.1.n123.h1234567, 1.2.3-n123.h1234567, or 1.2.3.
40+
- 2.0.1-0.dev.git.5810.hf475e7a4 return git hash
41+
- 2.0.0-beta.1 return tag
42+
- 2.0.0 return tag
4143
"""
42-
tag_hash_split = re.split(r"[\.|-]n\d\d\d\.h", version)
43-
if len(tag_hash_split) == 2:
44-
return tag_hash_split[1]
45-
else:
46-
return tag_hash_split[0]
44+
m = re.match(r"\d+\.\d+\.\d+(-.+\.h([0-9a-f]+))$", version)
45+
if m:
46+
return m.group(2)
47+
return version
4748

4849

4950
# FIXME: Stop relying on chartpress to modify Chart.yaml (and values.yaml) by

0 commit comments

Comments
 (0)