Skip to content

Commit 1e0621c

Browse files
committed
ci: skip vsce publish if version already exists
1 parent 9a57218 commit 1e0621c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/npm-publish.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,14 @@ jobs:
106106

107107
- name: Package and publish extension
108108
working-directory: vscode-extension
109-
run: vsce publish --no-dependencies
109+
run: |
110+
vsce publish --no-dependencies 2>&1 | tee /tmp/vsce-out.txt
111+
EXIT=${PIPESTATUS[0]}
112+
if [ $EXIT -ne 0 ] && grep -q "already exists" /tmp/vsce-out.txt; then
113+
echo "✓ Version already on Marketplace — skipping (not an error)"
114+
exit 0
115+
fi
116+
exit $EXIT
110117
env:
111118
VSCE_PAT: ${{ secrets.VSCE_PAT }}
112119

0 commit comments

Comments
 (0)