From 615ea4c22d9e5d49f28db71b665ed28dbea383a8 Mon Sep 17 00:00:00 2001 From: Inferencebot Date: Thu, 19 Nov 2026 23:57:52 +0000 Subject: [PATCH] security: pin actions, install without scripts, use locked vsce --- .gitea/workflows/publish.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml index 413f8c8..da45a31 100644 --- a/.gitea/workflows/publish.yaml +++ b/.gitea/workflows/publish.yaml @@ -9,11 +9,12 @@ jobs: publish: runs-on: ubuntu-latest steps: + # Actions are pinned by commit SHA, not floating tags: a tag can be moved. - name: Check out - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: '24' @@ -31,7 +32,9 @@ jobs: fi - 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 run: npm run package @@ -39,4 +42,6 @@ jobs: - name: Publish to VS Marketplace env: 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