From 2afdabfd639e7fc1506bd4f16ecbb11a6c68f918 Mon Sep 17 00:00:00 2001
From: shenjack <3695888@qq.com>
Date: Sat, 20 Apr 2024 22:53:42 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=80=E7=82=B9=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
deploy.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/deploy.py b/deploy.py
index 05f2fd0..bd90182 100644
--- a/deploy.py
+++ b/deploy.py
@@ -51,11 +51,13 @@ def get_env_info() -> dict[str, str]:
env_info["message"] = message.stdout.strip()
# git tag
if ON_CF:
- tag = "cf_pages"
+ tag = "cf_pages" or run(
+ ["git", "describe", "--tags"], capture_output=True, text=True, encoding="utf-8"
+ ).stdout.split("-")[0]
else:
tag = run(
["git", "describe", "--tags"], capture_output=True, text=True, encoding="utf-8"
- ).stdout
+ ).stdout.split("-")[0]
env_info["tag"] = tag.strip()
return env_info
@@ -94,7 +96,7 @@ if __name__ == "__main__":
border = border_template.format(f"#{hash_color:06x}")
# git 信息:
- version_info = f"{file_branch_name}/{branch}:{tag}
{message}"
+ version_info = f"{file_branch_name}/{branch}:{tag}-{commit[:6]}
{message}"
marker = marker_template.format(version_info)
print(f"Branch: {file_branch_name}\n{border}\n{marker}\n")
@@ -104,7 +106,7 @@ if __name__ == "__main__":
border = border_template.format("greenyellow")
# git 信息:
- version_info = f"{branch}:{tag}"
+ version_info = f"{branch}:{tag}-{commit[:6]}"
marker = marker_template.format(version_info)
print(f"Master: {border}\n{marker}\n")