1 parent babb2f2 commit 1b95797Copy full SHA for 1b95797
1 file changed
.github/workflows/ci.yml
@@ -31,6 +31,17 @@ jobs:
31
- name: Get current package version
32
id: current_version
33
run: echo "version=$(make version)" >> $GITHUB_OUTPUT
34
+ - name: Check NPM package version
35
+ id: check_npm_version
36
+ run: |
37
+ package_name=$(node -p "require('./package.json').name")
38
+ version="${{ steps.current_version.outputs.version }}"
39
+
40
+ if npm view "${package_name}@${version}" version >/dev/null 2>&1; then
41
+ echo "exists=true" >> "$GITHUB_OUTPUT"
42
+ else
43
+ echo "exists=false" >> "$GITHUB_OUTPUT"
44
+ fi
45
- uses: mukunku/tag-exists-action@v1.4.0
46
id: check_tag
47
with:
@@ -45,5 +56,5 @@ jobs:
56
prerelease: false
57
replacesArtifacts: true
58
- name: Publish to NPM
48
- if: steps.check_tag.outputs.exists == 'false'
59
+ if: steps.check_npm_version.outputs.exists == 'false'
49
60
run: npm publish
0 commit comments