This project uses Dependabot and Snyk + npm audit in GitHub Actions to continuously detect vulnerable dependencies, open automated upgrade PRs, and block CI on high/critical issues.
-
/.github/dependabot.yml- Daily update checks for:
npmdependencies- GitHub Actions dependencies
- Auto-generated dependency PRs with labels (
dependencies,security,automated-pr) - Grouping rules to keep update PRs manageable
- Daily update checks for:
-
/.github/workflows/dependency-scan.yml- Runs on:
- pushes to
main,master,develop - PRs targeting
mainanddevelop - scheduled daily run (
cron) - manual dispatch
- pushes to
- Uses
npm audit --audit-level=highto fail on high/critical vulnerabilities - Runs
snyk test(ifSNYK_TOKENis set) and fails on high/critical vulnerabilities - Runs
snyk monitoron non-PR events to keep Snyk project monitoring and alerting up to date
- Runs on:
-
/.github/workflows/ci-cd.yml- Adds
dependency-vulnerability-gatejob to the CI pipeline - Blocks pipeline progression if high/critical vulnerabilities are detected
- Executes
snyk testin CI when configured
- Adds
SNYK_TOKEN(recommended)- Add in: GitHub repository Settings -> Secrets and variables -> Actions
- Without it,
npm auditgating still runs, but Snyk checks/monitoring are skipped
- Dependabot alerts and security update PRs are managed by GitHub once Dependabot is enabled in the repo
- Snyk alerts are generated through
snyk monitorsnapshots (requiresSNYK_TOKEN) - Failed GitHub Action runs provide immediate CI signal for high/critical findings
To enforce the security gate, require these checks in branch protection for main:
Dependency Vulnerability Gatenpm audit (block high/critical)fromdependency-scan.ymlSnyk test (block high/critical)(ifSNYK_TOKENis configured)
- Tune update cadence and grouping in
/.github/dependabot.yml - Tune severity threshold in workflows via
--audit-level=highand--severity-threshold=high - Rotate
SNYK_TOKENperiodically and after any exposure