fix: use consistent short SHA generation across workflows (#238)

- Replace manual cut -c1-7 with git rev-parse --short in docker.yml
- Ensures consistent short SHA length between build.yml and docker.yml
- Git automatically adjusts length for uniqueness, preventing conflicts
This commit is contained in:
安正超
2025-07-17 05:48:30 +08:00
committed by GitHub
parent 9c3cf554d3
commit ee5f94a2e2

View File

@@ -110,7 +110,8 @@ jobs:
fi
# Extract version info from commit message or use commit SHA
short_sha=$(echo "${{ github.event.workflow_run.head_sha }}" | cut -c1-7)
# Use Git to generate consistent short SHA (ensures uniqueness like build.yml)
short_sha=$(git rev-parse --short "${{ github.event.workflow_run.head_sha }}")
# Determine build type based on branch and commit
if [[ "${{ github.event.workflow_run.head_branch }}" == "main" ]]; then