Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
play

GitHub Action

CycloneDX GoMod Generate SBOM

v1.0.0

CycloneDX GoMod Generate SBOM

play

CycloneDX GoMod Generate SBOM

Github action to generate a CycloneDX SBOM for Go modules

Installation

Copy and paste the following snippet into your .yml file.

              

- name: CycloneDX GoMod Generate SBOM

uses: CycloneDX/gh-gomod-generate-sbom@v1.0.0

Learn more about this action in CycloneDX/gh-gomod-generate-sbom

Choose a version

gh-gomod-generate-sbom

GitHub action to generate a CycloneDX SBOM for Go modules.

This action uses cyclonedx-gomod to generate SBOMs.

Inputs

version

Required. The version of cyclonedx-gomod to use.
Can be a version range, in which case the latest version matching the range is chosen.
Minimum allowed version is v1.0.0. Must either be an existing semantic version (e.g. v1.0.0, 1.0.0) or a version range.

args

Optional. Arguments to pass to cyclonedx-gomod.
Please refer to the cyclonedx-gomod documentation for usage instructions.
When not set, cyclonedx-gomod will only be downloaded, but not executed.
It'll be made available via $PATH and can be used by later steps of the workflow.

Example usage

# Download and invoke cyclonedx-gomod in a single step
- name: Generate SBOM
  uses: CycloneDX/gh-gomod-generate-sbom@v0.3.0
  with:
    version: v1
    args: mod -licenses -json -output bom.json

# Just download cyclonedx-gomod and call it in a later step
- name: Download cyclonedx-gomod
  uses: CycloneDX/gh-gomod-generate-sbom@v0.3.0
  with:
    version: v1.0.0
- name: Generate SBOM
  run: cyclonedx-gomod app -licenses -files -output bom.xml -main cmd/acme-app