Skip to content

Commit 42b84e7

Browse files
author
Laurent Guitton
committed
ci(vscode): make Marketplace and Open VSX publishes idempotent
Skip each publish when the version is already live, so workflow_dispatch can re-run safely — needed to bootstrap the first Open VSX publish of an already-Marketplace-released version.
1 parent d83ce26 commit 42b84e7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/publish-vscode.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ jobs:
8989
echo "::error::VSCE_PAT secret is not set — cannot publish."
9090
exit 1
9191
fi
92+
VER=$(node -p "require('./package.json').version")
93+
if pnpm exec vsce show gitwand.gitwand-vscode --json 2>/dev/null | grep -q "\"version\": \"${VER}\""; then
94+
echo "::notice::gitwand-vscode ${VER} already on the Marketplace, skipping"
95+
exit 0
96+
fi
9297
# Publish the exact .vsix built in the Package step (core is already
9398
# bundled in, so the package is self-contained).
9499
pnpm exec vsce publish --packagePath gitwand-vscode-*.vsix
@@ -103,5 +108,10 @@ jobs:
103108
echo "::warning::OVSX_PAT secret is not set — skipping Open VSX publish."
104109
exit 0
105110
fi
111+
VER=$(node -p "require('./package.json').version")
112+
if curl -fsS "https://open-vsx.org/api/gitwand/gitwand-vscode/${VER}" >/dev/null 2>&1; then
113+
echo "::notice::gitwand-vscode ${VER} already on Open VSX, skipping"
114+
exit 0
115+
fi
106116
# Same self-contained .vsix as the Marketplace publish above.
107117
pnpm exec ovsx publish --packagePath gitwand-vscode-*.vsix --pat "$OVSX_PAT"

0 commit comments

Comments
 (0)