Safeguard
Developer Tools•

How do you publish an SBOM with a GitHub release?

Attach a generated SBOM to a GitHub release as an asset: build it in CI, name it by version, use a draft release, and know what the repo export covers.

Safeguard Security Team
3 min read

Generate the SBOM during your release build, name it after the version, attach it as a release asset, then publish. Use a draft release first so every asset is in place, because repositories with immutable releases will not let you change assets after publishing. GitHub's own export is a separate, repository level inventory.

Steps

  1. Generate the SBOM in the same job that builds the artifacts, from the same commit.
  2. Name it clearly, for example myapp-1.5.0.spdx.json or myapp-1.5.0.cdx.json. The extension tells readers the format.
  3. Create the release as a draft.
  4. Attach the binaries, the SBOM and any signature or checksum files.
  5. Check the assets, then publish.
gh release create v1.5.0 --draft dist/myapp dist/myapp-1.5.0.cdx.json
  1. Link to the SBOM from your release notes.

Why the draft step matters

GitHub documents immutable releases. If your repository has them enabled, assets cannot be changed once a release is published. It recommends creating a draft, attaching everything, then publishing. If you forget the SBOM, you will need a new release version. Title, notes and the pre release or latest flags can still be edited.

Two different SBOMs

SourceWhat it describesFormatGood for
Your release assetThe built artifact for that versionYour choiceCustomers and auditors of that release
GitHub dependency graph exportThe repository's dependenciesSPDXA quick inventory, or a starting point

The export, found under Insights, then Dependency graph, then Export SBOM, or through the REST API, inventories your dependencies with versions, identifiers, licenses and transitive paths. It does not include dependents. The API is a two step flow: request generation, then poll until the response changes from 202 to a redirect and download.

The repository export reflects the repo as it stands. It does not know what your build step pulled in, so a release asset generated from the build is a better record of what shipped.

Keep it honest

  • Generate after the final build, not before.
  • Add a checksum of the SBOM next to the artifact checksums.
  • Do not edit an SBOM by hand after generation. If it is wrong, fix the generator.

If your project publishes packages as well as release assets, also publish the SBOM next to the package where your registry supports it, so consumers find it in one place. Keep the release asset as the record, and treat any copy as a convenience. When a customer asks for the SBOM of a past version, you want to point to one fixed file, not regenerate it from memory.

Quick check

Can I replace an SBOM on a published release?

Only if the repository does not use immutable releases. Do not count on it. Use a draft.

Is the GitHub export enough for customers?

It is a useful inventory, but an SBOM generated from your build better reflects what you shipped.

Safeguard's SBOM and dependency scanning ingests SBOMs from your releases, and a free scan is available at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.