`npm audit` fails the build with a critical in a devDependency used only for tests
BeginnerTroubleshootingSAST, SCA and secrets scanning in CI
Answer
Likely causes → npm audit checks all dependencies by default, including dev tooling that never ships to production.
Diagnose →
npm audit --omit=dev --audit-level=high
npm ls <package>
Fix → Gate on production deps: npm audit --omit=dev --audit-level=high. Still update the dev package when a fix exists (npm update <pkg> or an overrides entry).
Prevent → Separate gates: block on prod-reachable highs, report dev-only findings as warnings. Let Renovate keep dev tooling current.
More on SAST, SCA and secrets scanning in CI
gitleaks fails the PR on `tests/fixtures/fake_rsa.pem` and `testdata/aws_creds.json`, which only contain dummy valuesBeginnergitleaks passes locally but the CI job reports 40 old leaks nobody touched in this PRIntermediate`fatal: ambiguous argument 'origin/main..HEAD': unknown revision` in the secrets-scan stepBeginnerSemgrep flags `subprocess.run(cmd, shell=True)` in a script where `cmd` is a hard-coded constantBeginnerSemgrep in CI reports findings in `node_modules/`, `vendor/` and minified `dist/*.js`BeginnerSemgrep job takes 35 minutes and gets killed with `exit code 137`Intermediate