Fix sbom for docker image
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
17
.github/workflows/release.yaml
vendored
17
.github/workflows/release.yaml
vendored
@@ -98,8 +98,21 @@ jobs:
|
|||||||
- name: Get image digest
|
- name: Get image digest
|
||||||
id: image
|
id: image
|
||||||
run: |
|
run: |
|
||||||
# Extract image digest from goreleaser output
|
# Get the digest from the registry using docker buildx imagetools
|
||||||
echo "digest=$(docker inspect ghcr.io/getprobo/probo:${{ github.ref_name }} --format='{{index .RepoDigests 0}}' | cut -d'@' -f2)" >> "$GITHUB_OUTPUT"
|
DIGEST=$(docker buildx imagetools inspect ghcr.io/getprobo/probo:${{ github.ref_name }} --format '{{.Manifest.Digest}}' 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
if [ -z "$DIGEST" ]; then
|
||||||
|
echo "Failed to get digest from registry, trying alternative method..."
|
||||||
|
# Alternative: use the latest tag if version-specific tag fails
|
||||||
|
DIGEST=$(docker buildx imagetools inspect ghcr.io/getprobo/probo:latest --format '{{.Manifest.Digest}}' 2>/dev/null || echo "")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$DIGEST" ]; then
|
||||||
|
echo "Error: Could not retrieve image digest from registry"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "digest=$DIGEST" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Attest Docker image SBOM
|
- name: Attest Docker image SBOM
|
||||||
uses: actions/attest-sbom@v1
|
uses: actions/attest-sbom@v1
|
||||||
|
|||||||
Reference in New Issue
Block a user