From d5550e334c7672e170f8a3d20b4167df5858722f Mon Sep 17 00:00:00 2001 From: Nicolas Antoniazzi Date: Thu, 19 Nov 2026 14:25:09 +0100 Subject: [PATCH 1/2] ci: pin GitHub Actions to commit SHAs A tag can be moved to point at other code if the action repository is compromised. Each action is pinned to the commit its tag points at today, so behavior is unchanged, with the version kept in a comment for Dependabot and readers. --- .github/workflows/check_build.yml | 12 ++++++------ .github/workflows/release.yml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check_build.yml b/.github/workflows/check_build.yml index 5f993e0..73c5601 100644 --- a/.github/workflows/check_build.yml +++ b/.github/workflows/check_build.yml @@ -9,12 +9,12 @@ jobs: name: Lint commits runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 with: # we actually need "github.event.pull_request.commits + 1" commit fetch-depth: 0 - name: Volta - uses: volta-cli/action@v4 + uses: volta-cli/action@5c175f92dea6f48441c436471e6479dbc192e194 # v4.2.1 - run: npm ci - run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose check: @@ -23,21 +23,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 with: fetch-depth: 0 - name: Volta - uses: volta-cli/action@v4 + uses: volta-cli/action@5c175f92dea6f48441c436471e6479dbc192e194 # v4.2.1 - name: Install dependencies run: npm ci - name: Build run: npm run build - name: Generate release notes preview id: build-release-notes - uses: guilhermetod/semantic-release-notes-preview@v1.0.0 + uses: guilhermetod/semantic-release-notes-preview@015a2c1849e7703ee43e0350b04970ae3a76b49d # v1.0.0 - name: Comment release notes preview if: steps.build-release-notes.outputs.releaseNotes - uses: peter-evans/create-or-update-comment@v1 + uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae # v1.4.5 with: issue-number: ${{ github.event.number }} body: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 831e0cf..3a7e28d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,9 +9,9 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 - name: Volta - uses: volta-cli/action@v4 + uses: volta-cli/action@5c175f92dea6f48441c436471e6479dbc192e194 # v4.2.1 - name: Install dependencies run: npm ci - name: Build From ecf59d456687976f0cf428b195eb56e4178a9896 Mon Sep 17 00:00:00 2001 From: Nicolas Antoniazzi Date: Thu, 19 Nov 2026 14:25:09 +0100 Subject: [PATCH 2/2] ci: keep release tokens away from dependency install scripts The release job no longer persists the GITHUB_TOKEN in .git/config (semantic-release authenticates through the GITHUB_TOKEN env var) and installs dependencies with --ignore-scripts, so a compromised package cannot run code next to the npm token. No Linux dependency of this package needs an install script; the build still runs explicitly. --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a7e28d..eb96898 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 + with: + persist-credentials: false - name: Volta uses: volta-cli/action@5c175f92dea6f48441c436471e6479dbc192e194 # v4.2.1 - name: Install dependencies - run: npm ci + run: npm ci --ignore-scripts - name: Build run: npm run build - name: Release