Skip to content

Commit d42e0ca

Browse files
authored
fix: prefix snapshot version SHA with g to avoid semver leading zero error (#628)
## Summary - Release workflow failed because `cargo metadata` rejects semver pre-release identifiers with leading zeros (e.g. `0.0.0-07710393.20260225-0413`) - Prefix the short SHA with `g` (git convention) so the identifier is alphanumeric (`g07710393`), bypassing the numeric leading-zero rule - This affects ~6.25% of commits (those whose SHA starts with `0`) ## Test plan - [x] Verified the only consumer is `release.yml` which uses the version string opaquely - [ ] Re-run the release workflow to confirm it passes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 0771039 commit d42e0ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/actions/set-snapshot-version/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Set Snapshot Version
2-
description: Set snapshot version (0.0.0-{sha}.{timestamp}) for pre-release builds
2+
description: Set snapshot version (0.0.0-g{sha}.{timestamp}) for pre-release builds
33

44
outputs:
55
version:
@@ -15,5 +15,5 @@ runs:
1515
run: |
1616
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-8)
1717
BUILD_TIME=$(date -u +%Y%m%d-%H%M)
18-
VERSION="0.0.0-${SHORT_SHA}.${BUILD_TIME}"
18+
VERSION="0.0.0-g${SHORT_SHA}.${BUILD_TIME}"
1919
echo "version=${VERSION}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)