Skip to content

Commit 5be8f68

Browse files
committed
ci: replace cosign with oras for SBOM attestation
Switch from cosign to oras for attaching SBOMs to container images, aligning with OCI 1.1 referrers API specification.
1 parent 607c214 commit 5be8f68

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/build-and-deploy.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,14 @@ jobs:
8181
docker rm temp-container
8282
ls -lh ./sbom.spdx.json
8383
84-
- name: Install cosign
85-
uses: sigstore/cosign-installer@v3
84+
- name: Install ORAS
85+
uses: oras-project/setup-oras@v1
8686

87-
- name: Attest SBOM (cosign)
87+
- name: Attach SBOM (oras)
8888
run: |
89-
# --yes avoids the interactive tlog consent prompt in CI.
90-
COSIGN_EXPERIMENTAL=1 cosign attest --yes \
91-
--registry-referrers-mode=oci-1-1 \
92-
--type spdx --predicate ./sbom.spdx.json \
93-
"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build_and_push.outputs.digest }}"
89+
set -euo pipefail
90+
oras attach \
91+
--artifact-type application/spdx+json \
92+
--distribution-spec v1.1-referrers-api \
93+
"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build_and_push.outputs.digest }}" \
94+
./sbom.spdx.json:application/spdx+json

0 commit comments

Comments
 (0)