Description
.github/dependabot.yml keeps pnpm-lock.yaml current, but there is no generated software bill of materials artifact for a given release commit, so answering "exactly which package versions shipped in production build X" requires reconstructing it from the lockfile after the fact. Add a CI step that generates a CycloneDX SBOM from pnpm-lock.yaml on release builds and uploads it as a build artifact.
Requirements and context
- Add an SBOM-generation step (e.g.
@cyclonedx/cyclonedx-npm) to .github/workflows/ci.yml, gated to release/tag builds so every PR does not pay the cost
- Upload the resulting SBOM as a GitHub Actions artifact attached to the workflow run
- Add a small verification script asserting the generated SBOM is well-formed JSON and includes the expected root package
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested execution
Fork the repo and create a branch
git checkout -b feature/sbom-generation
Implement changes
- Update/Write:
.github/workflows/ci.yml
- Update/Write:
scripts/verify-sbom.ts
- Add/Update tests:
scripts/verify-sbom.ts
- Add documentation:
README.md
- Include clear code comments and TS types
- Validate security assumptions
Test and commit
- Run tests:
pnpm test
- Cover edge cases
- Include test output and security notes
Example commit message
feat: generate CycloneDX SBOM on release builds
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
.github/dependabot.ymlkeepspnpm-lock.yamlcurrent, but there is no generated software bill of materials artifact for a given release commit, so answering "exactly which package versions shipped in production build X" requires reconstructing it from the lockfile after the fact. Add a CI step that generates a CycloneDX SBOM frompnpm-lock.yamlon release builds and uploads it as a build artifact.Requirements and context
@cyclonedx/cyclonedx-npm) to.github/workflows/ci.yml, gated to release/tag builds so every PR does not pay the costSuggested execution
Fork the repo and create a branch
Implement changes
.github/workflows/ci.ymlscripts/verify-sbom.tsscripts/verify-sbom.tsREADME.mdTest and commit
pnpm testExample commit message
Guidelines