Skip to content

Commit e250528

Browse files
committed
fix: prevent npm version error when tag matches package.json version
1 parent 2d23f65 commit e250528

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ jobs:
4545
- name: Update package version
4646
run: |
4747
TAG_VERSION=${GITHUB_REF#refs/tags/v}
48-
npm version $TAG_VERSION --no-git-tag-version
48+
CURRENT_VERSION=$(node -p "require('./package.json').version")
49+
if [ "$TAG_VERSION" != "$CURRENT_VERSION" ]; then
50+
npm version $TAG_VERSION --no-git-tag-version
51+
else
52+
echo "Version already matches tag version $TAG_VERSION, skipping npm version"
53+
fi
4954
5055
- name: Publish to NPM
5156
run: npm publish --access public

0 commit comments

Comments
 (0)