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.0Inputs
Section titled “Inputs”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.
| Input | Required | Default | What it does |
|---|---|---|---|
url | yes | Base URL of your Affectra instance, e.g. https://affectra.example.com | |
organization | yes | Your Affectra organization (the slug in its URLs). Must be the API key's organization, or trust this repository. | |
api-key | no | An 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). | |
audience | no | Audience of the GitHub OIDC token. Defaults to url; set it only if your Affectra admin says so. | |
product | yes | Product name. Created if it does not exist. | |
variant | no | Variant 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. | |
version | yes | Release version, e.g. the tag name (github.ref_name) on a tag build. Created if new. | |
sbom | yes | SBOM files to upload, one path or glob per line (** works). All go to the same release. | |
provenance | no | Build 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-at | no | Release date (RFC 3339, e.g. 2026-11-05T12:00:00Z). Used only when the release is created. | |
sign | no | false | true 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.
Outputs
Section titled “Outputs”Read an output in a later step as ${{ steps.<id>.outputs.<name> }}, where <id> is the id you gave the upload step.
| Output | What it holds |
|---|---|
release-id | ID of the release the SBOMs went to |
release-url | Link to the release in the Affectra web app |
sbom-ids | IDs of the uploaded SBOMs, one per line, in file order |
attestation-ids | IDs of the uploaded build provenance attestations, one per line, in file order |
The API behind the action
Section titled “The API behind the action”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.
Rate limits
Section titled “Rate limits”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.
From version 1
Section titled “From version 1”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.
Versions
Section titled “Versions”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.