security: pin actions, install without scripts, use locked vsce

This commit is contained in:
inference-admin committed 2026-11-19 23:57:52 +00:00
1 parent 28d736f627
commit 615ea4c22d
1 file changed
+9 -4
+9 -4
View File
@@ -9,11 +9,12 @@ jobs:
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Actions are pinned by commit SHA, not floating tags: a tag can be moved.
- name: Check out - name: Check out
uses: actions/checkout@v4 uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Set up Node - name: Set up Node
uses: actions/setup-node@v4 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with: with:
node-version: '24' node-version: '24'
@@ -31,7 +32,9 @@ jobs:
fi fi
- name: Install dependencies - name: Install dependencies
run: npm ci # No lifecycle scripts: package install must not run repository code
# with the publishing token anywhere in the job.
run: npm ci --ignore-scripts --no-audit --fund=false
- name: Type-check, lint, and bundle - name: Type-check, lint, and bundle
run: npm run package run: npm run package
@@ -39,4 +42,6 @@ jobs:
- name: Publish to VS Marketplace - name: Publish to VS Marketplace
env: env:
VSCE_PAT: ${{ secrets.VSCE_PAT }} VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: npx vsce publish -p "$VSCE_PAT" --skip-duplicate # Use the locked local vsce, never `npx` (which can fetch a different
# package version from the registry at publish time).
run: ./node_modules/.bin/vsce publish -p "$VSCE_PAT" --skip-duplicate