Use a consistent short SHA length.

This commit is contained in:
supahgreg 2025-10-16 19:30:15 +00:00
parent b2b835ac0d
commit e2fce86d40
No known key found for this signature in database
2 changed files with 3 additions and 4 deletions

View File

@ -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)

View File

@ -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)) {