Interview Prep/GitHub Actions/Debugging, Cost, Monorepos & Releases

How do you produce SBOMs and attach them to a release?

IntermediateConceptDebugging, Cost, Monorepos & Releases
Answer
- uses: anchore/sbom-action@v0
  with:
    image: ${{ env.IMAGE }}@${{ needs.build.outputs.digest }}
    format: spdx-json
    output-file: sbom.spdx.json
- run: gh release upload "$GITHUB_REF_NAME" sbom.spdx.json
  env:
    GH_TOKEN: ${{ github.token }}

For stronger guarantees, attach the SBOM as an attestation (actions/attest-sbom) so consumers can verify who produced it. Trivy can generate SBOMs too (trivy image --format cyclonedx).

All GitHub Actions questions Roadmap: GitHub Actions

More on Debugging, Cost, Monorepos & Releases