{{ define "main" }}
Reference

SBOMlyze GitHub Action

Compares an SBOM in the checked-out pull request or commit with a baseline from git, the latest GitHub release, a successful default-branch workflow artifact, an explicit HTTPS URL, or a local workspace file. It does not run an SBOM generator or execute repository-provided commands.

Recommended workflow

Pin all Actions to full commit SHAs. The SHA below is the published {{ site.Params.version }} Action; the binary version defaults to the same release.

.github/workflows/sbom-review.yml
name: SBOM review

on:
  pull_request:

permissions:
  contents: read
  security-events: write

jobs:
  sbom-diff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          fetch-depth: 0

      # Generate or commit the head SBOM in a separate, reviewed step.
      # SBOMlyze deliberately does not accept or execute generator commands.
      - id: sbomlyze
        uses: rezmoss/sbomlyze@{{ site.Params.actionSha }} # {{ site.Params.version }}
        with:
          sbom-path: build/sbom.cdx.json
          policy: .github/sbom-policy.json
          fail-on: policy
          sarif: true

      - uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
        if: always() && steps.sbomlyze.outputs.report-sarif != ''
        with:
          sarif_file: {{ `${{ steps.sbomlyze.outputs.report-sarif }}` }}

Remove security-events: write, sarif: true, and the upload step if SARIF is not required. Forked pull requests may not receive permission to upload SARIF; the Job Summary remains available.

Inputs

{{ range site.Data.action.inputs }} {{ end }}
Input Required Default Meaning
{{ .k }} {{ .r }} {{ .v }} {{ .m }}

Baseline providers

Five ways to answer “what should this build be compared against?”

{{ range site.Data.action.baselines }}
{{ .k }}
{{ .t }}
{{ .d }}
{{ end }}

Outputs

{{ range site.Data.action.outputs }}
{{ .k }}
{{ .d }}
{{ end }}

Outputs and the Job Summary are written before a configured gate fails, so use if: always() when consuming reports from a later step.

Security behaviour

{{ range site.Data.action.security }}
{{ . }}
{{ end }}
{{ end }}