Skip to content

Commit 70e4591

Browse files
authored
chore: use currently set npm version on package.json (#147)
1 parent 610f092 commit 70e4591

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ jobs:
5858
run: npm install
5959

6060
- name: Update version in package.json
61-
run: npm version $(echo ${{ steps.version.outputs.version }} | sed 's/^v//') --no-git-tag-version
61+
run: |
62+
NEW_VERSION=$(echo ${{ steps.version.outputs.version }} | sed 's/^v//')
63+
CURRENT_VERSION=$(node -p "require('./package.json').version")
64+
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
65+
npm version $NEW_VERSION --no-git-tag-version
66+
else
67+
echo "Version is already $NEW_VERSION, skipping npm version"
68+
fi
6269
6370
- name: Publish to NPM
6471
run: npm publish

0 commit comments

Comments
 (0)