fix: version tag getter

This commit is contained in:
xxnuo
2026-01-01 17:22:12 +08:00
parent cc47d01f7a
commit 89c0ec96d8
2 changed files with 2 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ jobs:
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
VERSION="v$(cat package.json | grep '\"version\"' | head -1 | sed 's/.*\"version\": \"\(.*\)\".*/\1/')"
fi
echo "Syncing version to ${VERSION}"
bun run bump ${VERSION}

View File

@@ -37,7 +37,7 @@ jobs:
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
VERSION="v$(cat package.json | grep '\"version\"' | head -1 | sed 's/.*\"version\": \"\(.*\)\".*/\1/')"
fi
echo "Syncing version to ${VERSION}"
bun run bump ${VERSION}