Skip to content

Commit bc910a6

Browse files
committed
ci: harden GitHub Actions supply chain
Remove the unused, unpinned denolib/setup-deno@v2 third-party action from the release and test workflows (Deno is used nowhere in the repo), pin every remaining action to a full commit SHA, and add least-privilege permissions blocks. - release.yml: drop the Setup Deno step; pin checkout, setup-node, and attest-build-provenance to SHAs; add a top-level default-deny `permissions: {}` while the release job keeps its explicit write grants. - test.yml: drop the Setup Deno step; upgrade checkout v2 (EOL Node 16) to v4 pinned to a SHA; pin setup-node; add `permissions: contents: read`. - documentation.yml: pin checkout and setup-python to SHAs; add `permissions: contents: read`. Resolves deepsec findings other-ci-supply-chain (0995a86e73, e6c687034d).
1 parent bdb5381 commit bc910a6

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎.github/workflows/documentation.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ on:
99
- '.github/workflows/documentation.yml'
1010
- 'wrangler.jsonc'
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
build:
1417
runs-on: ubuntu-latest
1518
steps:
16-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1720

18-
- uses: actions/setup-python@v5
21+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1922
with:
2023
python-version: 3.x
2124

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
repository_dispatch:
1212
types: [release-trigger]
1313

14+
# Default-deny baseline; the release job grants only the scopes it needs below.
15+
permissions: {}
16+
1417
jobs:
1518
release:
1619
name: Release
@@ -29,22 +32,17 @@ jobs:
2932
version: ${{ steps.extract-version.outputs.version }}
3033
steps:
3134
- name: Checkout
32-
uses: actions/checkout@v4
35+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
3336
with:
3437
fetch-depth: 0
3538
token: ${{ secrets.GITHUB_TOKEN }}
3639

3740
- name: Setup Node
38-
uses: actions/setup-node@v4
41+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3942
with:
4043
node-version: ${{ matrix.node-version }}
4144
cache: npm
4245

43-
- name: Setup Deno
44-
uses: denolib/setup-deno@v2
45-
with:
46-
deno-version: v1.x
47-
4846
- name: Validate trigger
4947
id: validate
5048
run: |
@@ -103,7 +101,7 @@ jobs:
103101
# by this workflow (GitHub attestations API).
104102
- name: Attest build provenance for release assets
105103
if: steps.release.outputs.released == 'true'
106-
uses: actions/attest-build-provenance@v2
104+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
107105
with:
108106
subject-path: |
109107
main.js

‎.github/workflows/test.yml‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
name: Test
22
on: push
33

4+
permissions:
5+
contents: read
6+
47
jobs:
58
test:
69
name: Test
710
runs-on: ubuntu-latest
811
steps:
912
- name: Checkout
10-
uses: actions/checkout@v2
13+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1114
with:
1215
fetch-depth: 0
1316
- name: Setup Node
14-
uses: actions/setup-node@v4
17+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1518
with:
1619
node-version: 22
1720
cache: 'npm'
18-
- name: Setup Deno
19-
uses: denolib/setup-deno@v2
20-
with:
21-
deno-version: v1.x
2221
- name: Install dependencies
2322
run: npm install
2423
- name: Lint

0 commit comments

Comments
 (0)