Skip to content

Commit 17a099a

Browse files
authored
ci: add zizmor static analysis for the workflows (#1016)
Runs zizmor over .github/workflows and publishes results to the Security tab via SARIF. Report-only for now (continue-on-error) since the existing workflows still have findings to clear; a follow-up fixes those and turns this into a hard gate. Answers the "do we have zizmor setup" question from the review on #996. Based this on jupyterlab's own zizmor workflow and put it together with Claude Code, running zizmor against our workflows locally to confirm it works.
1 parent fbe50e7 commit 17a099a

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/zizmor.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Static analysis of the GitHub Actions workflows with zizmor.
2+
# https://github.com/zizmorcore/zizmor
3+
name: GitHub Actions security (zizmor)
4+
5+
on:
6+
push:
7+
branches: [master]
8+
pull_request:
9+
branches: ["**"]
10+
11+
permissions: {}
12+
13+
jobs:
14+
zizmor:
15+
name: zizmor
16+
runs-on: ubuntu-latest
17+
permissions:
18+
security-events: write # upload-sarif needs this to publish results
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
persist-credentials: false
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
27+
28+
- name: Run zizmor
29+
# Report only for now. The existing workflows still have findings to work
30+
# through, so this uploads results to the Security tab instead of failing
31+
# the build. Flip to a hard gate once they're cleared. No token is passed,
32+
# so zizmor runs offline (skips the online-only audits) and avoids the API
33+
# rate limits its docs warn about.
34+
continue-on-error: true
35+
run: uvx zizmor@1.25.2 --format=sarif . > results.sarif
36+
37+
- name: Upload SARIF
38+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
39+
with:
40+
sarif_file: results.sarif
41+
category: zizmor

0 commit comments

Comments
 (0)