Allow the release info build script to work without requiring Git to be installed (#3105)

* Prevent panic if env GRAPHITE_GIT_COMMIT_HASH is less than 8 chars long

* Improve release info build script

* Nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Timon
2025-09-05 09:09:29 +00:00
committed by GitHub
parent 5d441c2e18
commit c081d0a9de
2 changed files with 53 additions and 17 deletions

View File

@@ -51,7 +51,7 @@ pub fn commit_info_localized(localized_commit_date: &str) -> String {
{}",
GRAPHITE_RELEASE_SERIES,
GRAPHITE_GIT_COMMIT_BRANCH,
&GRAPHITE_GIT_COMMIT_HASH[..8],
GRAPHITE_GIT_COMMIT_HASH.get(..8).unwrap_or(GRAPHITE_GIT_COMMIT_HASH),
localized_commit_date
)
}