Skip to content

Commit f59145b

Browse files
njb90claude
andcommitted
ci: fix vsix build trigger and branch name sanitization
- Trigger on pull_request instead of all non-main pushes - Sanitize branch name (replace / with -) to avoid path errors in the output filename; switch to @vscode/vsce (vsce is deprecated) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c533236 commit f59145b

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/build-vsix.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: Build VSIX
22

33
on:
4-
push:
5-
branches-ignore:
4+
pull_request:
5+
branches:
66
- main
7+
types: [opened, synchronize, reopened]
78

89
jobs:
910
build-vsix:
@@ -26,12 +27,16 @@ jobs:
2627
- name: Run linting
2728
run: npm run lint
2829

30+
- name: Sanitize branch name
31+
id: branch
32+
run: echo "name=$(echo '${{ github.head_ref }}' | tr '/' '-')" >> "$GITHUB_OUTPUT"
33+
2934
- name: Package extension
30-
run: npx vsce package --no-dependencies -o cloudinary-${{ github.ref_name }}.vsix
35+
run: npx @vscode/vsce package --no-dependencies -o cloudinary-${{ steps.branch.outputs.name }}.vsix
3136

3237
- name: Upload VSIX artifact
3338
uses: actions/upload-artifact@v4
3439
with:
35-
name: cloudinary-${{ github.ref_name }}
36-
path: cloudinary-${{ github.ref_name }}.vsix
40+
name: cloudinary-${{ steps.branch.outputs.name }}
41+
path: cloudinary-${{ steps.branch.outputs.name }}.vsix
3742
retention-days: 14

0 commit comments

Comments
 (0)