yea?
This commit is contained in:
parent
77f3e2b460
commit
7394146e6a
@ -7,19 +7,19 @@ def get_env_info() -> dict[str, str]:
|
|||||||
env_info = {}
|
env_info = {}
|
||||||
# git branch
|
# git branch
|
||||||
branch = run(
|
branch = run(
|
||||||
"git branch --show-current", capture_output=True, text=True, encoding="utf-8"
|
["git", "branch", "--show-current"], capture_output=True, text=True, encoding="utf-8"
|
||||||
)
|
)
|
||||||
env_info["branch"] = branch.stdout.strip()
|
env_info["branch"] = branch.stdout.strip()
|
||||||
# git commit hash
|
# git commit hash
|
||||||
commit = run("git rev-parse HEAD", capture_output=True, text=True, encoding="utf-8")
|
commit = run(["git", "rev-parse", "HEAD"], capture_output=True, text=True, encoding="utf-8")
|
||||||
env_info["commit"] = commit.stdout.strip()
|
env_info["commit"] = commit.stdout.strip()
|
||||||
# git commit message
|
# git commit message
|
||||||
message = run(
|
message = run(
|
||||||
"git log -1 --pretty=%B", capture_output=True, text=True, encoding="utf-8"
|
["git", "log", "-1", "--pretty=%B"], capture_output=True, text=True, encoding="utf-8"
|
||||||
)
|
)
|
||||||
env_info["message"] = message.stdout.strip()
|
env_info["message"] = message.stdout.strip()
|
||||||
# git tag
|
# git tag
|
||||||
tag = run("git describe --tags", capture_output=True, text=True, encoding="utf-8")
|
tag = run(["git", "describe", "--tags"], capture_output=True, text=True, encoding="utf-8")
|
||||||
env_info["tag"] = tag.stdout.strip()
|
env_info["tag"] = tag.stdout.strip()
|
||||||
return env_info
|
return env_info
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user