Skip to content

Commit 00f6598

Browse files
authored
chore: added zizmor to GH Actions ci workflow (#166)
* chore: added zizmor to GH Actions ci workflow * chore: actions now use pinned versions * chore: explicit package manager cache disable * test: testing stricter zizmor persona * chore: removed peter-evans/create-pull-request, added permission comment
1 parent c2e9adb commit 00f6598

4 files changed

Lines changed: 63 additions & 35 deletions

File tree

.github/actions/node-setup/action.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ runs:
88
using: 'composite'
99
steps:
1010
- name: Setup Node.js
11-
uses: actions/setup-node@v6
11+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
1212
with:
1313
node-version: ${{ inputs.node-version }}
14-
cache: 'npm'
15-
cache-dependency-path: package-lock.json
14+
package-manager-cache: false
1615

1716
- name: Install dependencies
1817
shell: bash

.github/workflows/build-wasm.yml

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
pull-requests: write
1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@v6
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2121
with:
2222
persist-credentials: false
2323

@@ -53,11 +53,11 @@ jobs:
5353
5454
- name: Set up Buildx Docker CLI plugin
5555
if: steps.check-branch.outputs.skip != 'true'
56-
uses: docker/setup-buildx-action@v3
56+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
5757

5858
- name: Build Docker image
5959
if: steps.check-branch.outputs.skip != 'true'
60-
uses: docker/build-push-action@v6
60+
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
6161
with:
6262
context: .
6363
load: true
@@ -92,18 +92,28 @@ jobs:
9292
9393
- name: Create Pull Request
9494
if: steps.check-branch.outputs.skip != 'true' && steps.git-check.outputs.changes == 'true'
95-
uses: peter-evans/create-pull-request@v6
96-
with:
97-
token: ${{ secrets.GITHUB_TOKEN }}
98-
commit-message:
99-
'chore: update SQLite Wasm binaries from ${{ steps.resolve-ref.outputs.sqlite_ref }}
100-
(${{ steps.resolve-ref.outputs.sqlite_sha }})'
101-
title:
102-
'chore: update SQLite Wasm binaries from ${{ steps.resolve-ref.outputs.sqlite_ref }}'
103-
body: |
104-
This PR updates the SQLite Wasm binaries in `src/bin` by building them from SQLite reference `${{ steps.resolve-ref.outputs.sqlite_ref }}` (commit `${{ steps.resolve-ref.outputs.sqlite_sha }}`).
105-
106-
Triggered by manual workflow dispatch.
107-
branch: ${{ steps.resolve-ref.outputs.branch_name }}
108-
base: main
109-
delete-branch: true
95+
env:
96+
BRANCH_NAME: ${{ steps.resolve-ref.outputs.branch_name }}
97+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
SQLITE_REF: ${{ steps.resolve-ref.outputs.sqlite_ref }}
99+
SQLITE_SHA: ${{ steps.resolve-ref.outputs.sqlite_sha }}
100+
run: |
101+
git config user.name "github-actions[bot]"
102+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
103+
104+
git switch -c "$BRANCH_NAME"
105+
git commit -m "chore: update SQLite Wasm binaries from ${SQLITE_REF} (${SQLITE_SHA})"
106+
gh auth setup-git
107+
git push origin "HEAD:${BRANCH_NAME}"
108+
109+
cat > pr-body.md <<EOF
110+
This PR updates the SQLite Wasm binaries in \`src/bin\` by building them from SQLite reference \`${SQLITE_REF}\` (commit \`${SQLITE_SHA}\`).
111+
112+
Triggered by manual workflow dispatch.
113+
EOF
114+
115+
gh pr create \
116+
--base main \
117+
--head "$BRANCH_NAME" \
118+
--title "chore: update SQLite Wasm binaries from ${SQLITE_REF}" \
119+
--body-file pr-body.md

.github/workflows/ci.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
contents: read
2525
steps:
2626
- name: Checkout repo
27-
uses: actions/checkout@v6
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2828
with:
29-
fetch-depth: 0
29+
persist-credentials: false
3030

3131
- name: Set up Node.js
3232
uses: ./.github/actions/node-setup
@@ -41,26 +41,48 @@ jobs:
4141
contents: read
4242
steps:
4343
- name: Checkout repo
44-
uses: actions/checkout@v6
44+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4545
with:
46-
fetch-depth: 0
46+
persist-credentials: false
4747

4848
- name: Setup environment (node + install)
4949
uses: ./.github/actions/node-setup
5050

5151
- name: Run format check
5252
run: npx oxfmt . --check
5353

54+
zizmor:
55+
name: Zizmor GitHub Actions check
56+
runs-on: ubuntu-latest
57+
permissions:
58+
# Needed by zizmor online audits to inspect workflow/action metadata.
59+
actions: read
60+
contents: read
61+
security-events: write
62+
steps:
63+
- name: Checkout repository
64+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
65+
with:
66+
persist-credentials: false
67+
68+
- name: Run zizmor
69+
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
70+
with:
71+
online-audits: true
72+
persona: auditor
73+
min-severity: informational
74+
min-confidence: low
75+
5476
test-browser:
5577
name: Run browser tests
5678
runs-on: ubuntu-latest
5779
permissions:
5880
contents: read
5981
steps:
6082
- name: Checkout repo
61-
uses: actions/checkout@v6
83+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6284
with:
63-
fetch-depth: 0
85+
persist-credentials: false
6486

6587
- name: Setup environment (node + install)
6688
uses: ./.github/actions/node-setup
@@ -73,7 +95,7 @@ jobs:
7395
>> $GITHUB_OUTPUT
7496

7597
- name: Cache Playwright browsers
76-
uses: actions/cache@v5
98+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
7799
id: playwright-cache
78100
with:
79101
path: ~/.cache/ms-playwright
@@ -104,9 +126,7 @@ jobs:
104126
node-version: [20, 22, 23, 24, 25]
105127
steps:
106128
- name: Checkout repo
107-
uses: actions/checkout@v6
108-
with:
109-
fetch-depth: 0
129+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
110130

111131
- name: Setup environment (node + install)
112132
uses: ./.github/actions/node-setup

.github/workflows/publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ jobs:
1616
id-token: write
1717
steps:
1818
- name: Checkout repo
19-
uses: actions/checkout@v6
20-
with:
21-
fetch-depth: 0
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2220

2321
- name: Setup environment (node + install)
2422
uses: ./.github/actions/node-setup
@@ -29,9 +27,10 @@ jobs:
2927
run: npm run prepublishOnly
3028

3129
- name: Configure npm for OIDC trusted publishing
32-
uses: actions/setup-node@v6
30+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
3331
with:
3432
node-version: 24
33+
package-manager-cache: false
3534
registry-url: https://registry.npmjs.org
3635

3736
- name: Publish to npm

0 commit comments

Comments
 (0)