Skip to content

ci: move dependency audits off unrelated PRs, add daily sweep - #1063

Open
SnowboardTechie wants to merge 5 commits into
mainfrom
bryan/scoped-dep-audit
Open

ci: move dependency audits off unrelated PRs, add daily sweep#1063
SnowboardTechie wants to merge 5 commits into
mainfrom
bryan/scoped-dep-audit

Conversation

@SnowboardTechie

@SnowboardTechie SnowboardTechie commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • A newly published advisory against a dependency already on main currently reds every open PR that touches a package's source, even when the PR changes no dependencies. This moves audits to where dependencies actually change, plus a daily sweep on main.
  • Time to review: 10 minutes

Changes proposed

  • Removes the audit step from the five per-package CI workflows (ci-lib-core, ci-lib-cli, ci-lib-ts-sdk, ci-lib-changelog-emitter, ci-website-preview). These ran on any PR touching the package's source, so an advisory that could only be fixed on main blocked every in-flight PR for that package.
  • Adds deps-audit.yml: a daily workspace-wide pnpm audit on main (15:00 UTC, plus workflow_dispatch), opening or updating a tracking issue on failure. Advisories that drop with no dependency PR in flight are caught within a day.

Context for reviewers

Dependency-changing PRs stay gated. Any dependency change in any workspace package updates the root pnpm-lock.yaml, which triggers the audit in ci-catalog-validation.yml. That gate is genuinely workspace-wide, not root-importer-only: pnpm audit --json at the root reports 1270 audited dependencies across all seven workspace projects.

Two behavior changes worth a second opinion:

  • Severity threshold on dependency-changing PRs. The removed steps failed at low (the four lib packages run bare pnpm audit) and at high (the website's audit:high). Catalog validation fails at moderate, its existing setting. The daily sweep runs at low, so low-severity advisories still surface within a day, as an issue rather than a PR blocker.
  • The HOLD-branch gating carve-out is subsumed, not lost. The if: github.base_ref == 'main' guard existed so advisories fixable only on main wouldn't block PRs into HOLD-* batching branches. Audits no longer run on per-package PRs at any base, which covers the same case more directly.

Out of scope, unchanged: the two Node templates keep their own audits (standalone projects outside the workspace, already tightly path-scoped), and the Python example audits stay continue-on-error: true per DEPENDENCY_MANAGEMENT.md.

Additional information

deps-audit.yml triggers on changes to itself, so the run on this PR exercises the real sweep end to end:

Run pnpm audit
No known vulnerabilities found

actionlint is clean on all six touched workflows.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Website Preview Deployed!

Preview your changes at: https://cg-pr-1063.billy-daly.workers.dev

This preview will be automatically deleted when the PR is closed.

New advisories against deps already on main were redding every open PR
that touched a package's source, even when the PR changed no deps.

- Per-package CI workflows no longer run the audit; it only ever ran on
  PRs there, and dep-changing PRs are already gated by the audit in
  ci-catalog-validation.yml (every dep change updates the root lockfile,
  which triggers it).
- audit-deps.js gains --recursive: plain `pnpm list` at the workspace
  root only covers the root importer (~49 pkgs), so the no-filter audit
  in ci-catalog-validation.yml was silently auditing almost nothing.
  With --recursive it covers all workspace projects (~800 pkgs).
- New deps-audit.yml runs the workspace-wide audit daily on main and
  opens/updates a tracking issue on failure, so advisories that drop
  with no dep PR in flight are still caught within a day.

Templates and examples keep their own audits: they are standalone
projects outside the workspace, tightly path-scoped already.
- postcss@<=8.5.22 -> >=8.5.23 (GHSA-fxqj-rqcc-2cmp, moderate) via
  website>@astrojs/react>vite>postcss; resolves to 8.5.25.
- body-parser@<1.20.6 -> >=1.20.6 <2 (GHSA-v422-hmwv-36x6, low) via
  lib/cli>express; bounded below 2 so express 4 keeps the 1.x line.

Verified: pnpm audit and audit-deps.js --recursive both clean; cli and
website test suites green against the new resolutions.
@SnowboardTechie
SnowboardTechie force-pushed the bryan/scoped-dep-audit branch from ececad9 to 1ce18cc Compare August 4, 2026 16:09
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Aug 4, 2026
@SnowboardTechie
SnowboardTechie marked this pull request as ready for review August 4, 2026 16:21
# Conflicts:
#	.github/scripts/audit-deps.js
#	.github/workflows/ci-catalog-validation.yml
#	.github/workflows/ci-lib-changelog-emitter.yml
#	.github/workflows/ci-lib-cli.yml
#	.github/workflows/ci-lib-core.yml
#	.github/workflows/ci-lib-ts-sdk.yml
#	.github/workflows/ci-website-preview.yml
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
The validate job no longer runs an audit step, so the comment describing
checks/tests/audit was stale.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant