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
23 changes: 19 additions & 4 deletions .github/workflows/publish-extension.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
name: Publish VS Code Extension

on:
push:
# Publish only when a PR into main is merged
pull_request:
branches:
- main
types:
- closed

jobs:
publish:
# Ensure we only run on merged PRs (not just closed)
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -18,15 +23,25 @@ jobs:
node-version: '20'

- name: Install dependencies
run: npm ci
run: npm install
Copy link

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

Changed from npm ci to npm install without justification. npm ci is preferred in CI environments as it performs faster, reliable, reproducible builds by installing directly from package-lock.json and fails if dependencies don't match the lock file.

Suggested change
run: npm install
run: npm ci

Copilot uses AI. Check for mistakes.

- name: Install vsce
run: npm install -g vsce

- name: Package extension
run: vsce package

- name: Upload VSIX artifact (optional)
uses: actions/upload-artifact@v4
with:
name: vsix
path: '*.vsix'
if-no-files-found: warn

- name: Publish to Marketplace
run: vsce publish --pat ${{ secrets.VSCE_TOKEN }}
env:
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
# Map your repo secret to the env var that vsce expects
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
run: |
# vsce reads token from VSCE_PAT; no need to pass --pat explicitly
vsce publish
Comment on lines +46 to +47
Copy link

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment states that vsce reads the token from VSCE_PAT, but this behavior should be verified. The previous approach using --pat was explicit and clear. Consider keeping the explicit token passing for better clarity and reliability.

Suggested change
# vsce reads token from VSCE_PAT; no need to pass --pat explicitly
vsce publish
# Explicitly pass the token using --pat for clarity and reliability
vsce publish --pat $VSCE_PAT

Copilot uses AI. Check for mistakes.
Loading