Commit ba3dd2a
ci: fix dependency-scan SBOM workflow to scan released packages (#1287)
## Summary
The `dependency-scan.yml` workflow has been silently broken since it was
added (SEC-7263, Nov 2025). Every run produces a 0-component SBOM and
vacuously passes the license policy check.
- **Root cause:** cdxgen internally runs `yarn install` but corepack was
never enabled, so it fell back to system yarn 1.x, failed silently, and
produced an empty BOM
- Enable corepack and install only released package dependencies (via
`yarn workspaces focus`) before cdxgen runs
- Scopes the scan to published packages only, excluding example apps and
contract tests that bring in LGPL-licensed dev tooling (e.g.
`@img/sharp-libvips` via Next.js)
## Changes
- `.github/workflows/dependency-scan.yml` -- add node setup, corepack,
and scoped dependency install before SBOM generation
- `scripts/released-packages.js` -- new script that reads
`.release-please-manifest.json` and prints workspace names of all
released packages
## Test plan
- [x] Verified locally: clean checkout (no yarn.lock, no node_modules)
produces 970 packages with zero LGPL violations
- [ ] Verify the `Dependency Scan` workflow runs green on this PR
Fixes SDK-2170
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk since this only changes CI dependency-scanning behavior, but
it could cause the `Dependency Scan` workflow to fail if Yarn workspace
focusing or the released-packages list is incorrect.
>
> **Overview**
> Fixes the `Dependency Scan` GitHub Action so SBOM generation runs with
the intended Node/Yarn toolchain and produces a **non-empty** BOM.
>
> The workflow now sets up Node 20, enables `corepack`, installs
dependencies for *released* workspaces via `yarn workspaces focus $(node
scripts/released-packages.js)`, and passes `ensure-non-empty: 'true'` to
the SBOM generator.
>
> Adds `scripts/released-packages.js`, which reads
`.release-please-manifest.json` and prints the corresponding workspace
package names to drive the focused install.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d73db95. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 972f90b commit ba3dd2a
2 files changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
15 | 29 | | |
16 | 30 | | |
17 | 31 | | |
18 | 32 | | |
| 33 | + | |
19 | 34 | | |
20 | 35 | | |
21 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments