Skip to content

Commit 88f2de1

Browse files
author
Test User
committed
fix: use --allow-same-version flag with npm version
- Simplifies version update step - Uses npm's built-in flag to allow setting same version - Prevents 'Version not changed' error when version already matches tag
1 parent d700bef commit 88f2de1

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,7 @@ jobs:
7878
7979
- name: Update package.json version
8080
run: |
81-
TAG_VERSION="${{ steps.get_version.outputs.version }}"
82-
CURRENT_VERSION=$(node -p "require('./package.json').version")
83-
echo "Current version: $CURRENT_VERSION"
84-
echo "Tag version: $TAG_VERSION"
85-
if [ "$CURRENT_VERSION" != "$TAG_VERSION" ]; then
86-
echo "Updating version from $CURRENT_VERSION to $TAG_VERSION"
87-
node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json')); pkg.version = '$TAG_VERSION'; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');"
88-
else
89-
echo "Version already matches tag: $CURRENT_VERSION - skipping update"
90-
fi
81+
npm version "${{ steps.get_version.outputs.version }}" --no-git-tag-version --allow-same-version
9182
9283
- name: Verify package.json
9384
run: |

0 commit comments

Comments
 (0)