CI Gate (GitHub Action)
Crashtest ships as a composite action for other repositories. One step:
- uses: dhaupin/[email protected]
with:
config: crashtest.config.js # path, relative to repo root
run-tests: 'false' # 'true' also runs npm test before the gate
node-version: '22'
What it does
- Installs
crashtest(no save, no side effects on your lockfile) - Optionally runs your own
npm testfirst - Runs the gate:
npx crashtest run --config <path> - Uploads the run as the
hardening-reportartifact (always) - Exits with the gate result - your workflow blocks on it
Committed in your repo: labs/crashledger.json (from your first - adopted -
run). CI compares against it. Exit 1 means:
- a NEW ⚡ EXPLOITED finding appeared, or
- a previously 🛡 REFUSED surface regressed to EXPLOITED.
Exit 0 reads: nothing new weak, nothing old broke. Exit 2 reads:
configuration is wrong - the workflow should fail too, but visibly.
Adopting in steps (no-change path)
The gate only bites on delta, so a legacy repo can adopt safely:
- Run locally, review the found weaknesses, fix the cheap ones
- Where a risk is deliberate, bound it in scenario ctx (BOUNDED needs an owner + bound - without both it’s a finding)
- Commit the ledger → CI is now the memory that forgets nothing