Skip to content

Commit 0fb4575

Browse files
committed
ci: configure zizmor
See https://docs.zizmor.sh. This runs on PRs and pushes to main. It uses the most basic "regular" persona as a starting point.
1 parent 792ac0b commit 0fb4575

4 files changed

Lines changed: 77 additions & 0 deletions

File tree

.github/workflows/zizmor.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# https://docs.zizmor.sh/
2+
name: zizmor
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
merge_group:
12+
branches:
13+
- main
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
17+
cancel-in-progress: true
18+
19+
permissions: {}
20+
21+
jobs:
22+
zizmor:
23+
name: 🌈 GitHub Actions security analysis
24+
runs-on: ubuntu-slim
25+
permissions:
26+
contents: read # checkout repository
27+
28+
steps:
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
with:
31+
persist-credentials: false
32+
33+
- uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3
34+
with:
35+
persona: pedantic
36+
# Use annotations instead of SARIF as this doesn't need special permissions
37+
annotations: true
38+
advanced-security: false

.github/zizmor.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Existing privileged PR automation is intentionally isolated to these workflows:
2+
# they do not checkout pull request head code, and they only comment or set status.
3+
rules:
4+
dangerous-triggers:
5+
ignore:
6+
- dependency-diff-comment.yml
7+
- lunaria.yml
8+
- semantic-pull-requests.yml
9+
- welcome-close.yml
10+
- welcome-open.yml

CONTRIBUTING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ pnpm mock-connector # Start the mock connector (no npm login needed)
123123
pnpm vp run lint # Run linter (oxlint + oxfmt)
124124
pnpm lint:fix # Auto-fix lint issues
125125
pnpm test:types # TypeScript type checking
126+
pnpm vp run zizmor # GitHub Actions security analysis
126127

127128
# Testing
128129
pnpm test # Run all Vitest tests
@@ -133,6 +134,28 @@ pnpm test:a11y # Lighthouse accessibility audits
133134
pnpm test:perf # Lighthouse performance audits (CLS)
134135
```
135136

137+
### GitHub Actions security analysis
138+
139+
CI runs [zizmor](https://docs.zizmor.sh/) against the repository's GitHub Actions workflows. The shared policy lives in `.github/zizmor.yml`, and the `zizmor` task uses the same pedantic persona as CI.
140+
141+
You may run it locally by [installing `zizmor`](https://docs.zizmor.sh/installation/) and running:
142+
143+
```bash
144+
pnpm vp run zizmor
145+
```
146+
147+
Some audits resolve action refs and vulnerability metadata through GitHub. To run those online checks locally, authenticate with the GitHub CLI and pass its token:
148+
149+
```bash
150+
GH_TOKEN="$(gh auth token)" pnpm vp run zizmor
151+
```
152+
153+
To fix audit findings automatically, run:
154+
155+
```bash
156+
GH_TOKEN="$(gh auth token)" pnpm vp run zizmor:fix
157+
```
158+
136159
### Clearing caches during development
137160

138161
Nitro persists `defineCachedEventHandler` results to disk at `.nuxt/cache/nitro/`. This cache **survives dev server restarts**. If you're iterating on a cached API route and want fresh results, delete the relevant cache directory:

vite.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ export default defineConfig({
3131
'lint:css': {
3232
command: 'node scripts/unocss-checker.ts',
3333
},
34+
'zizmor': {
35+
command: 'zizmor --pedantic .',
36+
},
37+
'zizmor:fix': {
38+
command: 'zizmor --pedantic --fix .',
39+
},
3440
'build:lunaria': {
3541
command: 'node ./lunaria/lunaria.ts',
3642
},

0 commit comments

Comments
 (0)