Skip to content

Commit 81d1238

Browse files
Ajit Pratap Singhclaude
authored andcommitted
fix(ci): publish each VSIX individually and add safety checks
- Loop over vsix files instead of glob expansion (vsce may not handle multiple --packagePath args from shell glob correctly) - Add VSCE_PAT presence check before publish step - Add semver format validation for tag-derived version - Remove empty overrides block from package.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e38674f commit 81d1238

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/vscode-publish.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ jobs:
7070
working-directory: vscode-extension
7171
run: |
7272
VERSION="${GITHUB_REF_NAME#v}"
73+
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
74+
echo "Tag '$GITHUB_REF_NAME' does not produce a valid semver: '$VERSION'"
75+
exit 1
76+
fi
7377
npm version "$VERSION" --no-git-tag-version
7478
7579
- name: Package VSIX
@@ -102,7 +106,20 @@ jobs:
102106
merge-multiple: true
103107
path: vsix
104108

109+
- name: Verify VSCE_PAT is set
110+
run: |
111+
if [ -z "$VSCE_PAT" ]; then
112+
echo "Error: VSCE_PAT secret is not configured"
113+
exit 1
114+
fi
115+
env:
116+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
117+
105118
- name: Publish all platforms
106119
env:
107120
VSCE_PAT: ${{ secrets.VSCE_PAT }}
108-
run: vsce publish --packagePath vsix/*.vsix
121+
run: |
122+
for vsix in vsix/*.vsix; do
123+
echo "Publishing $vsix..."
124+
vsce publish --packagePath "$vsix"
125+
done

vscode-extension/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,5 @@
264264
"glob": "^10.3.10",
265265
"mocha": "^10.2.0",
266266
"typescript": "^5.3.2"
267-
},
268-
"overrides": {}
267+
}
269268
}

0 commit comments

Comments
 (0)