File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -167,15 +167,18 @@ jobs:
167167 - name : Update SDK version
168168 working-directory : ts-mapped-sdk
169169 run : |
170- # Read current version or default to 0.0.0
171- if [ -f package.json ]; then
170+ # Read current version from the committed SDK package.json (HEAD),
171+ # falling back to the working copy or 0.0.0 if necessary.
172+ if git show HEAD:package.json >/tmp/original_package.json 2>/dev/null; then
173+ CURRENT_VERSION=$(node -p "require('/tmp/original_package.json').version || '0.0.0'")
174+ elif [ -f package.json ]; then
172175 CURRENT_VERSION=$(node -p "require('./package.json').version || '0.0.0'")
173176 else
174177 CURRENT_VERSION="0.0.0"
175178 fi
176179
177180 # Bump patch version
178- NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
181+ NEW_VERSION=$(echo " $CURRENT_VERSION" | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
179182
180183 # Update package.json with new version
181184 node -e "
You can’t perform that action at this time.
0 commit comments