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.
Pin all Actions to full commit SHAs. The SHA below is the published v0.5.3 Action; the binary version defaults to the same release.
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@db9182a06acbc58a66143978765f096a576f1f9c # v0.5.3
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.
| Input | Required | Default | Meaning |
|---|---|---|---|
| sbom-path | yes | — | Repository-relative head SBOM path. |
| base-sbom-path | no | sbom-path | Different repository-relative path at the baseline revision. |
| baseline | no | git | git, release, workflow-artifact, url, or file. |
| baseline-repository | no | current repo | OWNER/REPO for release or artifact lookup. |
| baseline-asset | for release | — | Exact asset name in the latest non-draft, non-prerelease release. |
| baseline-artifact | for artifact | — | Exact artifact name from the newest successful default-branch run containing it. |
| baseline-artifact-path | no | base-sbom-path | Exact SBOM path inside the artifact ZIP. |
| baseline-url | for url | — | Public HTTPS URL; credentials and the GitHub token are never forwarded. |
| baseline-path | no | base-sbom-path | Repository-relative workspace file used by baseline: file. |
| policy | no | — | Repository-relative SBOMlyze JSON policy. |
| comment | no | false | Create or update one pull-request comment. |
| github-token | no | github.token | Token used for provenance, comments, release assets, and workflow artifacts. |
| sarif | no | false | Generate report-sarif. |
| fail-on | no | policy | policy, integrity-drift, any-change, or never. |
| version | no | v0.5.3 | Exact binary release; floating values such as latest are rejected. |
Five ways to answer “what should this build be compared against?”
baseline: gitbaseline: releasebaseline: workflow-artifactbaseline: urlbaseline: fileverdictadded-count · removed-count · changed-countintegrity-drift-countreport-json · report-markdown · report-sarifOutputs and the Job Summary are written before a configured gate fails, so use if: always() when consuming reports from a later step.