File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070 pnpm set //npm.pkg.github.com/:_authToken="$NODE_AUTH_TOKEN";
7171 pnpm nx build sbom;
7272
73+ # - name: Install CycloneDX CLI & Validate CycloneDX SBOMs
74+
7375 - name : Upload SBOM artifacts
7476 if : ${{ github.event_name == 'push' || github.event.inputs.SBOM == 'true' }}
7577 uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change 2020 NX_SKIP_NX_CACHE : true
2121 FILTER : ${{ github.event_name == 'workflow_dispatch' && inputs.filter || '' }}
2222 SET_TIMESTAMP_VERSION : ${{ inputs.tag == 'daily' }}
23+ CYCLONEDX_CLI_VERSION : 0.32.0
2324
2425jobs :
2526 build :
8182 pnpm set "//npm.pkg.github.com/:_authToken" "$env:NODE_AUTH_TOKEN"
8283 pnpm nx build sbom;
8384
85+ - name : Install CycloneDX CLI
86+ shell : bash
87+ run : |
88+ # extract to sbom pnpm project / scripts? (./packages/sbom/project.json)
89+ tool_dir="$RUNNER_TEMP/cyclonedx-cli"
90+ mkdir -p "$tool_dir"
91+ curl -fsSL "https://github.com/CycloneDX/cyclonedx-cli/releases/download/v${{ env.CYCLONEDX_CLI_VERSION }}/cyclonedx-win-x64.exe" -o "$tool_dir/cyclonedx.exe"
92+ chmod +x "$tool_dir/cyclonedx.exe" || true
93+ echo "$tool_dir" >> "$GITHUB_PATH"
94+
95+ - name : Validate CycloneDX SBOMs
96+ shell : bash
97+ run : |
98+ shopt -s nullglob
99+ sbom_files=(packages/sbom/dist/*.sbom.json)
100+
101+ if [ ${#sbom_files[@]} -eq 0 ]; then
102+ echo "No SBOM files found in packages/sbom/dist"
103+ exit 1
104+ fi
105+
106+ for file in "${sbom_files[@]}"; do
107+ echo "Validating $file"
108+ cyclonedx validate --input-file "$file" --input-format json --fail-on-errors
109+ done
110+
84111 - name : Build artifacts package
85112 run : pnpm run make-artifacts-package
86113
You can’t perform that action at this time.
0 commit comments