From 7dbc25df9b8e3fdbfed4ef298846f89cbe7088b7 Mon Sep 17 00:00:00 2001 From: Ahmed Tokyo Date: Mon, 19 Oct 2026 16:30:28 +0100 Subject: [PATCH 1/2] ci: move checkout and setup-node to v7 (Node 24 runtime) The v4 actions run on Node 20, which GitHub deprecated. v7 runs on Node 24. The publish job drops the npm dependency cache, as setup-node recommends for OIDC publishing: a poisoned cache could reach the token. CI keeps its cache. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ef52bd..5ea7680 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,8 @@ jobs: node: [22, 24] # engines floor (22.13+) and latest name: node ${{ matrix.node }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} cache: npm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1905e8..334c533 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: tag: ${{ steps.version.outputs.tag }} should_release: ${{ steps.version.outputs.should_release }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - id: version name: Resolve version and decide whether to release run: | @@ -58,11 +58,12 @@ jobs: contents: read id-token: write # npm provenance (OIDC), no long-lived NPM_TOKEN steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: node-version: 24 - cache: npm + # No dependency cache in the publish job: a poisoned cache could reach the OIDC token. + package-manager-cache: false registry-url: https://registry.npmjs.org - run: npm ci - run: npm run lint @@ -82,7 +83,7 @@ jobs: permissions: contents: write # create the tag and GitHub Release steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Create GitHub Release (skipped if it already exists) run: | if gh release view "$TAG" > /dev/null 2>&1; then From 6995e4426b9f21c92833f07250764cc1c9ffe077 Mon Sep 17 00:00:00 2001 From: Ahmed Tokyo Date: Mon, 19 Oct 2026 16:45:48 +0100 Subject: [PATCH 2/2] ci: pin actions to commit SHAs Tags can be moved; a commit SHA cannot. Each pin keeps its version as a comment, and Dependabot (github-actions, weekly) bumps both together. --- .github/dependabot.yml | 7 +++++++ .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..60ace0e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# Workflow actions are pinned to commit SHAs; this keeps the pins (and their version comments) current. +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ea7680..ec9fbab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,8 @@ jobs: node: [22, 24] # engines floor (22.13+) and latest name: node ${{ matrix.node }} steps: - - uses: actions/checkout@v7 - - uses: actions/setup-node@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: ${{ matrix.node }} cache: npm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 334c533..089f9ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: tag: ${{ steps.version.outputs.tag }} should_release: ${{ steps.version.outputs.should_release }} steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - id: version name: Resolve version and decide whether to release run: | @@ -58,8 +58,8 @@ jobs: contents: read id-token: write # npm provenance (OIDC), no long-lived NPM_TOKEN steps: - - uses: actions/checkout@v7 - - uses: actions/setup-node@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24 # No dependency cache in the publish job: a poisoned cache could reach the OIDC token. @@ -83,7 +83,7 @@ jobs: permissions: contents: write # create the tag and GitHub Release steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Create GitHub Release (skipped if it already exists) run: | if gh release view "$TAG" > /dev/null 2>&1; then