From 91cc4a2e1c5f5114a683cc33160717ef79856f85 Mon Sep 17 00:00:00 2001 From: Hamza Khalid Date: Tue, 24 Jun 2025 20:38:34 +0500 Subject: [PATCH] enforce 9-character Git SHA in build script --- .github/workflows/support-docker.yml | 4 ++-- crates/cli/build.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/support-docker.yml b/.github/workflows/support-docker.yml index a504e9f42b..c78a6081a7 100644 --- a/.github/workflows/support-docker.yml +++ b/.github/workflows/support-docker.yml @@ -26,11 +26,11 @@ jobs: - name: Generate version tag id: version run: | - echo "version=$(git rev-parse --short=8 HEAD)" >> $GITHUB_OUTPUT + echo "version=$(git rev-parse --short=9 HEAD)" >> $GITHUB_OUTPUT - name: Generate tags id: tags run: | - VERSION=$(git rev-parse --short=7 HEAD) + VERSION=$(git rev-parse --short=9 HEAD) TAGS="${{ env.IMAGE_NAME }}:$VERSION" if [ "${{ github.ref }}" = "refs/heads/main" ]; then TAGS="$TAGS,${{ env.IMAGE_NAME }}:latest" diff --git a/crates/cli/build.rs b/crates/cli/build.rs index 5df4faa153..de4c6cde3f 100644 --- a/crates/cli/build.rs +++ b/crates/cli/build.rs @@ -3,7 +3,7 @@ use std::process::Command; fn main() { // Try to get local git SHA first let output = Command::new("git") - .args(&["rev-parse", "--short", "HEAD"]) + .args(&["rev-parse", "--short=9", "HEAD"]) .output(); let git_sha = match output { @@ -42,7 +42,7 @@ fn get_remote_commit_hash() -> Option { .split_whitespace() .next()? .chars() - .take(7) + .take(9) .collect::(); if commit_hash.is_empty() {