Skip to content

Commit 7ad26ee

Browse files
committed
fix(ci): fix broken release, address issue during attestation step
The SLSA provenance predicate was changed to a different value, this caused a digest to be empty, leading to a cascaded failure. - Replace `slsa.dev/provenance/v0.2` with `v1` (`docker/build-push-action` v6 generates v1): this is the actual fix - Add empty-digest guards on attestation, provenance, and SBOM lookup steps: this will provide a more clear message if something like that happens again. - Add missing `-r` flag to jq in SBOM digest step: this is a minor improvemnt. It prevents double quuotes to land into the `crane` command later on. Signed-off-by: Flavio Castelli <fcastelli@suse.com> Assisted-by: Claude Sonnet 4.6
1 parent e9a6208 commit 7ad26ee

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/attestation.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,32 @@ jobs:
5959
| jq -r '.manifests[]
6060
| select(.annotations["vnd.docker.reference.type"] == "attestation-manifest")
6161
| .digest')
62+
if [[ -z "${DIGEST}" ]]; then
63+
echo "ERROR: No attestation manifest found for ${{ inputs.component }} (${{ inputs.arch }})"
64+
exit 1
65+
fi
6266
echo "ATTESTATION_MANIFEST_DIGEST=${DIGEST}" >> "$GITHUB_ENV"
6367
- name: Find provenance manifest digest
6468
run: |
6569
set -e
6670
DIGEST=$(crane manifest ghcr.io/${{ github.repository_owner }}/${{ inputs.component }}@${{ env.ATTESTATION_MANIFEST_DIGEST }} |
6771
jq -r '.layers[]
68-
| select(.annotations["in-toto.io/predicate-type"] == "https://slsa.dev/provenance/v0.2")
72+
| select(.annotations["in-toto.io/predicate-type"] == "https://slsa.dev/provenance/v1")
6973
| .digest')
74+
if [[ -z "${DIGEST}" ]]; then
75+
echo "ERROR: No SLSA provenance layer found in attestation manifest for ${{ inputs.component }} (${{ inputs.arch }})"
76+
exit 1
77+
fi
7078
echo "PROVENANCE_DIGEST=${DIGEST}" >> "$GITHUB_ENV"
7179
- name: Find SBOM manifest layer digest
7280
run: |
7381
set -e
7482
DIGEST=$(crane manifest ghcr.io/${{github.repository_owner}}/${{ inputs.component }}@${{ env.ATTESTATION_MANIFEST_DIGEST}} | \
75-
jq '.layers | map(select(.annotations["in-toto.io/predicate-type"] == "https://spdx.dev/Document")) | map(.digest) | join(" ")')
83+
jq -r '.layers | map(select(.annotations["in-toto.io/predicate-type"] == "https://spdx.dev/Document")) | map(.digest) | join(" ")')
84+
if [[ -z "${DIGEST}" ]]; then
85+
echo "ERROR: No SBOM layer found in attestation manifest for ${{ inputs.component }} (${{ inputs.arch }})"
86+
exit 1
87+
fi
7688
echo "SBOM_DIGEST=${DIGEST}" >> "$GITHUB_ENV"
7789
7890
# We need to upload provenance and SBOM files, plus their signatures under the GitHub Release page.

0 commit comments

Comments
 (0)