Skip to content

upload-sbom action

affectra/upload-sbom is a GitHub Action that uploads the SBOMs of a build to the release they describe. For steps and examples, see Upload SBOMs from GitHub Actions. The tables below are the inputs and outputs of release v2.1.0.

Pin the action to a full commit SHA and write the version in a comment:

- uses: affectra/upload-sbom@9d96158dc5e1155428b006b8d1fa37458afb5e98 # v2.1.0

You pass inputs with with:. Inputs that hold paths take one path or glob per line, and ** matches any depth. A line that matches nothing fails the step.

InputRequiredDefaultWhat it does
urlyesBase URL of your Affectra instance, e.g. https://affectra.example.com
organizationyesYour Affectra organization (the slug in its URLs). Must be the API key's organization, or trust this repository.
api-keynoAn Affectra organization API key (exk_...), from a secret. Leave it out to use the job's GitHub OIDC token instead (needs permissions id-token: write, and the repository trusted in Affectra under Trusted publishers).
audiencenoAudience of the GitHub OIDC token. Defaults to url; set it only if your Affectra admin says so.
productyesProduct name. Created if it does not exist.
variantnoVariant of the product (a hardware revision, platform, edition or SKU). Created if the product has no variant with this name. Leave it out for the product's default variant.
versionyesRelease version, e.g. the tag name (github.ref_name) on a tag build. Created if new.
sbomyesSBOM files to upload, one path or glob per line (** works). All go to the same release.
provenancenoBuild provenance bundles to upload to the same release after the SBOMs, one path or glob per line: the bundle-path output of actions/attest-build-provenance. Needs Affectra with build provenance. Leave it out to upload SBOMs only.
released-atnoRelease date (RFC 3339, e.g. 2026-11-05T12:00:00Z). Used only when the release is created.
signnofalsetrue signs each SBOM with Sigstore (cosign sign-blob, keyless) and uploads the signature with it. Needs cosign 2.4 or later on the runner (sigstore/cosign-installer) and permissions id-token write. Without it, a <file>.sigstore.json next to an SBOM is uploaded as its signature.

Also, the url must start with https://. Plain http:// is accepted only for localhost.

Read an output in a later step as ${{ steps.<id>.outputs.<name> }}, where <id> is the id you gave the upload step.

OutputWhat it holds
release-idID of the release the SBOMs went to
release-urlLink to the release in the Affectra web app
sbom-idsIDs of the uploaded SBOMs, one per line, in file order
attestation-idsIDs of the uploaded build provenance attestations, one per line, in file order

The action sends one request per file. Any CI can do the same. See Upload SBOMs from other CI.

Request What it does
POST /v1/orgs/{org}/sbom-uploads?product=&variant=&version=&released_at= Uploads an SBOM to the release with these names. Creates what is missing. variant and released_at are optional.
POST /v1/orgs/{org}/attestation-uploads?product=&variant=&version=&released_at= Uploads a build provenance bundle to the release with these names.
POST /v1/orgs/{org}/releases/{release}/sboms Uploads an SBOM to a release by its ID.
POST /v1/orgs/{org}/releases/{release}/attestations Uploads a build provenance bundle to a release by its ID.
GET /v1/orgs/{org}/releases/{release}/sboms Lists the SBOMs of a release.
GET /v1/orgs/{org}/releases/{release}/vulnerabilities Lists a page of the advisories that affect a release. Each item names the finding groups it is in (groups) and says whether they conflict (conflict).
GET /v1/orgs/{org}/releases/{release}/finding-groups Lists a page of the finding groups of a release: one item per CVE, with its advisories, components and conflicts.

All of them take the credential as Authorization: Bearer <credential>: an API key, or for the first two, the GitHub Actions token of a trusted repository. They answer errors as JSON with a code and a detail. Using the API covers credentials, errors and rate limits. Every operation is described in the API reference.

Affectra limits how fast an organization can upload. When it answers 429 Too Many Requests, the action waits for the seconds in the Retry-After header (30 if there is none) and tries the file once more. If the wait is over 300 seconds, it does not wait. If the second try is refused too, the step fails with Affectra’s message. Connection errors and 5xx answers are retried up to four times with a short wait.

Version 2 renames the input hardware-revision to variant and makes it optional. Rename the input in your workflow and use a version 2 release. Your existing releases keep their names. Affectra refuses an upload that still sends hardware_revision with a 400, so a workflow that was not changed fails instead of uploading into the default variant.

Pin to a version you have checked. Version tags such as v2.1.0 do not move. Check the releases of the action for new versions.