Repository navigation
Commit 5b09c71
committed
ci: add tirith security scan and fail-fast preflight gate
Add a security gate to the CI workflow so the expensive build/test work
runs only after the cheap, high-signal security checks pass.
Two new jobs run unconditionally and in parallel at the front of the
pipeline (not gated on `changes`, so they cover docs-only PRs and fork
PRs where local git hooks never run):
- `tirith-scan`: scans the whole checkout with tirith
(https://tirith.sh/docs/ci/), uploads SARIF to the Security tab, and
gates downstream CI. Wired on `pull_request` (not
`pull_request_target`), so fork PRs only get a read-only token and
cannot leak secrets while their code is scanned; the SARIF upload is
therefore skipped for forks (the scan and gate still run). tirith is
installed from the flake's pinned nixpkgs to match the dev shell.
- `preflight`: runs the existing `gitleaks` and `treefmt` flake checks
(treefmt carries actionlint + zizmor with the repo's exact ignore
config) as an early fail-fast gate before any build/test work.
`test` and `build-native-packages` now `needs` both gates, so they are
skipped unless the gates pass.
tirith details:
- `--fail-on high` blocks on high/critical findings. tirith's `--ci`
exit code is 0 = clean, 1 = at/above threshold, 2 = findings below
threshold; the gate treats 0/2 as pass and 1 (or any other code) as a
block, and the scan exit code is passed via env to avoid template
injection.
- `*.snap` is excluded because terminal snapshot test fixtures
intentionally contain ANSI escapes that trip the `ansi_escapes` rule;
the rule stays active for real source files.
Heavy gate jobs run on blacksmith runners, consistent with the rest of
the nix-based CI jobs.1 parent 17911d6 commit 5b09c71
1 file changed
Lines changed: 102 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
24 | 122 | | |
25 | | - | |
| 123 | + | |
26 | 124 | | |
27 | 125 | | |
28 | 126 | | |
| |||
50 | 148 | | |
51 | 149 | | |
52 | 150 | | |
53 | | - | |
| 151 | + | |
54 | 152 | | |
55 | 153 | | |
56 | 154 | | |
| |||
394 | 492 | | |
395 | 493 | | |
396 | 494 | | |
| 495 | + | |
| 496 | + | |
397 | 497 | | |
398 | 498 | | |
399 | 499 | | |
| |||
0 commit comments