fix(ci): short commit hash length#298
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a mismatch in short commit hash generation between GitHub workflows by standardizing the approach to use git rev-parse --short HEAD instead of bash substring extraction.
Key Changes:
- Replaced bash substring extraction (
${SHA::8}) with the native Git short hash command (git rev-parse --short HEAD) - Removed the unused full
SHAvariable, keeping onlySHA_SHORT - Aligned the hash generation method with the pattern already used in
release-package.yaml
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| SHA="$(git rev-parse HEAD)" | ||
| echo "SHA=$SHA" >> $GITHUB_ENV | ||
| echo "SHA_SHORT=${SHA::8}" >> $GITHUB_ENV | ||
| SHA_SHORT="$(git rev-parse --short HEAD)" |
There was a problem hiding this comment.
The --short flag without a specific length can produce variable-length hashes (typically 7 characters, but can increase if needed for uniqueness). For consistency between workflows, consider using --short=7 or --short=8 to ensure a fixed length. This is especially important since release-package.yaml references Docker images tagged with this SHA_SHORT value.
Example:
SHA_SHORT="$(git rev-parse --short=7 HEAD)"This would ensure both workflows always use the same hash length.
| SHA_SHORT="$(git rev-parse --short HEAD)" | |
| SHA_SHORT="$(git rev-parse --short=7 HEAD)" |
Description
there is a mismatch in short sha length between workflows
How Has This Been Tested?
Manually
Due Diligence