From bc55fb6459acb7df73cf33897141cf8712c3c5e9 Mon Sep 17 00:00:00 2001 From: Nicolas Antoniazzi Date: Thu, 19 Nov 2026 14:25:07 +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 4b1e25f..55eb93b 100644 --- a/.github/workflows/check_build.yml +++ b/.github/workflows/check_build.yml @@ -9,11 +9,11 @@ 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 - - uses: actions/setup-node@v6 + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 - 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: @@ -22,11 +22,11 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 with: fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 25.2.0 - name: Install dependencies @@ -35,10 +35,10 @@ jobs: 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 4b021e7..ca70309 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,9 +15,9 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 - name: Setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 25.2.0 - name: Install dependencies From 3f24bd083a5c4e1b0a61aa097cded898e425bbd8 Mon Sep 17 00:00:00 2001 From: Nicolas Antoniazzi Date: Thu, 19 Nov 2026 14:25:07 +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 ca70309..3258839 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,12 +16,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 25.2.0 - name: Install dependencies - run: npm ci + run: npm ci --ignore-scripts - name: Build run: npm run build - name: Release