Skip to content

Commit 8887f97

Browse files
author
jovanSAPFIONEER
committed
ci: skip npm publish if version already exists
1 parent f70e8a4 commit 8887f97

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ jobs:
102102
run: npm run build
103103

104104
- name: Publish to npm (with provenance)
105-
run: npm publish --provenance --access public
105+
run: |
106+
PKG_VERSION=$(node -p "require('./package.json').version")
107+
if npm view network-ai@$PKG_VERSION version 2>/dev/null; then
108+
echo "network-ai@$PKG_VERSION already published — skipping."
109+
else
110+
npm publish --provenance --access public
111+
fi
106112
env:
107113
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)