From e2fce86d40d19cee8b3a7820db0f273fc37e0910 Mon Sep 17 00:00:00 2001 From: supahgreg Date: Thu, 16 Oct 2025 19:30:15 +0000 Subject: [PATCH] Use a consistent short SHA length. --- .github/workflows/publish.yml | 5 ++--- classes/Config.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3a04f998e..d2ffa6417 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -63,7 +63,7 @@ jobs: run: echo "COMMIT_TIMESTAMP=$(git show -s --format=%ci HEAD)" >> $GITHUB_ENV - name: Get commit short SHA - run: echo "COMMIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + run: echo "COMMIT_SHORT_SHA=$(git rev-parse --abbrev=8 --short HEAD)" >> $GITHUB_ENV - name: Log in to GitHub Container Registry uses: docker/login-action@v3 @@ -137,8 +137,7 @@ jobs: - name: Generate version.json run: | # Get the commit short SHA (8 characters) expected by the backend - # TODO: switch to the full SHA everywhere - COMMIT_SHORT_SHA=$(git rev-parse --short HEAD) + COMMIT_SHORT_SHA=$(git rev-parse --abbrev=8 --short HEAD) # Get the commit timestamp in Unix format COMMIT_TIMESTAMP=$(git show -s --format=%ct HEAD) diff --git a/classes/Config.php b/classes/Config.php index 0a741fd73..35b8f423a 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -406,7 +406,7 @@ class Config { "timestamp" => 0, ]; - $proc = proc_open("git --no-pager log --pretty=\"version-%ct-%h\" -n1 HEAD", + $proc = proc_open('git --no-pager log --pretty="version-%ct-%h" --abbrev=8 -n1 HEAD', $descriptorspec, $pipes, $dir); if (is_resource($proc)) {