We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f22bd6 commit 94c9805Copy full SHA for 94c9805
backend/flakestry/api/publish.py
@@ -75,12 +75,17 @@ def publish(
75
commit_date = commit_json["commit"]["committer"]["date"]
76
77
# Validate & parse version
78
+ datetime = re.sub(r"[^0-9]", "", commit_date)
79
if publish.version:
- given_version = publish.version
80
+ given_version = publish.version.format(
81
+ datetime=datetime,
82
+ date=datetime[:8],
83
+ time=datetime[8:],
84
+ )
85
elif publish.ref and publish.ref.startswith("refs/tags/"):
86
given_version = publish.ref.removeprefix("refs/tags/")
87
else:
- given_version = f"v0.1.{re.sub(r'[^0-9]', '', commit_date)}"
88
+ given_version = f"v0.1.{datetime}"
89
90
version_regex = r"^v?([0-9]+\.[0-9]+\.?[0-9]*$)"
91
version = re.search(version_regex, given_version)
0 commit comments