Repository navigation
ci: attach per-package SBOMs to releases (3.x) - #19014
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
DanRibbens
left a comment
There was a problem hiding this comment.
Looks good. One mention is that IF we ever do manual releases locally from our machines in the future the SBOM won't be uploaded. I don't think this matters since you moved us to doing all releases in CI anyways.
591092a to
34751c7
Compare
|
🚀 This is included in version v3.92.1 |
Port of #18887 to
3.x. The first commit is the cherry-pick. The second commit has the3.xdifferences:ubuntu-24.04, like the rest of3.x. Will update3.xto 26 in a separate PR.writeStepSummary.ts, which3.xdoes not have. #18981 adds the same file with identical content, so the second PR to merge gets no conflict..github/scripts/**/*.spec.mjsto the vitestunitproject. Without it, the attach script spec does not run on3.x.SECURITY.mddescribes v3 releases.Each stable v3 draft GitHub Release now gets one
payload-sboms-<version>.zip. It holds a CycloneDX 1.6 and an SPDX 2.3 SBOM (software bill of materials: a machine-readable dependency list) for every published package, plus aSHA256SUMSfile. A push to3.xchecks that generation still works.Customers run security and compliance audits on the Payload packages they install. They need one SBOM per package, downloadable from the GitHub Release.
Changes
pnpm release-sbom)pnpm sbom --splitonce per format over the publish list. Flags are--prod --exclude-peers --sbom-type library.Organization: Payload CMS, LLC. pnpm ignores--sbom-supplierfor SPDX.SHA256SUMSintopayload-sboms-<version>/and zips that folder.generate-sbomsruns afterpublish. It installs, generates, and uploads the zip as an artifact.attach-sbomsuploads the zip to the draft release with the labelSBOMs.attach-sbomsfinishes. The script uploads to a draft or a published release.sbomjob runs the generator on push to3.xwhen lockfile, manifests, pnpm version, generator files, ormain.ymlchange. It is not part ofall-green.SECURITY.mddocuments the zip URL, the folder layout, what the SBOM covers, and checksum verification.Design Decisions
workspace:*deps fail to install there. Customers can scan their own lockfile to see what their install resolves to.--exclude-peers. The consumer's project providesnext,react, andpayload. Peers of transitive dependencies can still appear.publish.publishis unchanged, so an SBOM failure never blocks npm. "Re-run failed jobs" retries only the SBOM jobs.generate-sbomsruns third-party install scripts withcontents: read.attach-sbomsholdscontents: writeand runs no installed code. It checks out only.github/scripts/sbomand runs it throughactions/github-script.tag_name, so it finds a draft or a published release.GET /releases/tags/{tag}cannot be used, because it returns 404 for drafts.Overall Flow
tag v3.*.* pushed publish (environment: release, id-token: write) pnpm release-ci: build, npm publish, create draft release + generate-sboms (contents: read) + pnpm install + pnpm release-sbom: generate, check, SHA256SUMS, zip + upload artifact (zip) + attach-sboms (contents: write, no install) + download artifact + find release by tag_name + delete existing zip asset, upload zip with its labelReferences / Links
--splitoutput namesVerify After Merge
Local runs covered generation, the checks, the zip, and
SHA256SUMS. The items below run only in CI.3.x)needs_sbomfilter should start thesbomjob.generate-sbomsinstalls on a tag ref. The pnpm cache from3.xshould restore.generate-sbomstoattach-sbomsas an artifact.attach-sbomschecks out only.github/scripts/sbomand imports the script throughactions/github-script.GITHUB_TOKENfinds the draft that the App token created and uploads to it.payload-sboms-<version>.zip, with the labelSBOMs.attach-sbomsreplaces the zip. The release still has one asset.attach-sbomsfailsgh release upload.🤖 Written with AI