Skip to content

Commit bf78e03

Browse files
committed
Version check
1 parent c7a8d19 commit bf78e03

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/npm-publish.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ jobs:
2222
version: 8
2323
- name: Update version and publish
2424
run: |
25-
# Remove 'v' prefix from tag if present
2625
VERSION=${GITHUB_REF#refs/tags/}
2726
VERSION=${VERSION#v}
28-
pnpm version $VERSION --no-git-tag-version
27+
CURRENT_VERSION=$(jq -r .version package.json)
28+
29+
if [ "$VERSION" != "$CURRENT_VERSION" ]; then
30+
pnpm version "$VERSION" --no-git-tag-version
31+
fi
32+
2933
pnpm publish --no-git-checks
3034
env:
3135
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)