1- # Dependency Scan — License Compliance
2- #
3- # Generates a CycloneDX SBOM via cdxgen and evaluates it against an OPA/Rego
4- # license policy. This checks for disallowed licenses (e.g. GPL in a
5- # proprietary SDK) — it does NOT check for CVEs or security vulnerabilities.
6- # Vulnerability scanning is handled separately by dependency-review-action.
7- #
8- # See: SDK-2170, SEC-7263
91
102name : Dependency Scan
113
@@ -21,27 +13,19 @@ jobs:
2113 steps :
2214 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2315
24- # The shared generate-sbom action runs cdxgen, which internally invokes
25- # `yarn install` to resolve the dependency tree. This repo uses Yarn 3.x
26- # via corepack (packageManager field in package.json), so corepack must
27- # be enabled before cdxgen runs. Without this, cdxgen falls back to
28- # system yarn (1.x), fails silently, and produces a 0-component BOM.
29- - name : Setup Node with corepack
30- uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
16+ - uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
3117 with :
3218 node-version : 20.x
3319
3420 - name : Enable corepack
3521 run : corepack enable
3622
37- - name : Install dependencies (skip platform-specific optionals)
38- run : |
39- yarn config set supportedArchitectures.os --json '[]'
40- yarn config set supportedArchitectures.cpu --json '[]'
41- yarn config set supportedArchitectures.libc --json '[]'
42- yarn install
23+ - name : Install released package dependencies
24+ run : yarn workspaces focus $(node scripts/released-packages.js)
4325 env :
4426 YARN_ENABLE_IMMUTABLE_INSTALLS : ' false'
27+ YARN_ENABLE_SCRIPTS : ' false'
28+ ELECTRON_SKIP_BINARY_DOWNLOAD : ' 1'
4529
4630 - name : Generate SBOM
4731 uses : launchdarkly/gh-actions/actions/dependency-scan/generate-sbom@8220ae5b6e56f7108d076da0e710dc4feca15101 # main
5943 uses : launchdarkly/gh-actions/actions/dependency-scan/evaluate-policy@8220ae5b6e56f7108d076da0e710dc4feca15101 # main
6044 with :
6145 artifacts-pattern : bom-*
62-
63- # Guard against silent regression: if cdxgen fails to resolve
64- # dependencies (e.g. corepack not enabled), the BOM will contain
65- # 0 components and the policy evaluation vacuously passes.
66- - name : Verify SBOM contains components
67- run : |
68- COMPONENT_COUNT=$(jq '.components | length' bom.json)
69- echo "SBOM contains $COMPONENT_COUNT components"
70- if [ "$COMPONENT_COUNT" -eq 0 ]; then
71- echo "::error::SBOM contains 0 components — the scan produced nothing. Check that corepack is enabled and dependencies are installed."
72- exit 1
73- fi
0 commit comments