Skip to content

Commit e447cde

Browse files
committed
tweak publish.yml
1 parent f770316 commit e447cde

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ jobs:
2525
- name: Run build
2626
run: npm run build
2727

28+
- name: Check if version already exists on npm
29+
id: check
30+
run: |
31+
VERSION=$(node -p "require('./package.json').version")
32+
NAME=$(node -p "require('./package.json').name")
33+
if npm view $NAME@$VERSION > /dev/null 2>&1; then
34+
echo "exists=true" >> $GITHUB_OUTPUT
35+
else
36+
echo "exists=false" >> $GITHUB_OUTPUT
37+
fi
38+
2839
- name: Publish to npm
2940
run: npm publish --access public
3041
env:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "directus-helper",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"license": "MIT",
55
"bin": "dist/cli.js",
66
"type": "module",

0 commit comments

Comments
 (0)