Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ jobs:
- name: Package the extension
run: npm run package

- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: vscode-extension
path: "*.vsix"

deploy:
runs-on: ubuntu-latest
needs: build
Expand All @@ -38,16 +44,27 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Upload VSIX file
uses: actions/upload-artifact@v4
- name: Download VSIX artifact
uses: actions/download-artifact@v4
with:
name: vscode-extension
path: '**/*.vsix'

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Deploy to Marketplace
run: |
echo "Deploying to the marketplace..."
# Add your deployment script or command here
# For example, using vsce to publish the extension
npx vsce publish --pat ${{ secrets.VSCE_PAT }}
# Publish pre-built VSIX using the maintained @vscode/vsce package
FILE=$(ls -1 *.vsix | head -n 1)
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command will fail if no VSIX files are found, causing the deployment to fail silently. Add a check to ensure at least one VSIX file exists before attempting to list them, or use a more robust file selection method.

Suggested change
FILE=$(ls -1 *.vsix | head -n 1)
FILE=$(ls -1 *.vsix 2>/dev/null | head -n 1)
if [ -z "$FILE" ]; then
echo "Error: No VSIX files found to publish." >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
echo "Publishing $FILE"
if [ -z "${VSCE_PAT}" ]; then
echo "VSCE_PAT secret is not set" >&2
exit 1
fi
Comment on lines +64 to +67
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The VSCE_PAT validation is redundant since the secret is already referenced in the env block at line 70. GitHub Actions will automatically handle missing secrets, and this check adds unnecessary complexity to the deployment script.

Suggested change
if [ -z "${VSCE_PAT}" ]; then
echo "VSCE_PAT secret is not set" >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
npx @vscode/vsce publish --pat "${VSCE_PAT}" --packagePath "$FILE"
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}