A continuation of HomeBox the inventory and organization system built for the Home User
fix(ci): attest the published manifest list digest instead of a copied source manifest (#1685)
Datastream-x866e925b098fde
diff --git a/.github/workflows/docker-publish-hardened.yaml b/.github/workflows/docker-publish-hardened.yamlindex bcda1797..d5616f74 100644--- a/.github/workflows/docker-publish-hardened.yaml+++ b/.github/workflows/docker-publish-hardened.yaml@@ -217,14 +217,22 @@ jobs:run: |set -euo pipefaildocker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \- $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *) 2>&1 | tee /tmp/push-ghcr.out- digest=$(grep -oE 'sha256:[a-f0-9]{64}' /tmp/push-ghcr.out | head -n1 || true)+ $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *)+ tag=$(jq -r --arg repo "${{ env.GHCR_REPO }}" \+ '[.tags[] | select(ascii_downcase | startswith(($repo | ascii_downcase) + ":"))][0] // ""' \+ <<< "$DOCKER_METADATA_OUTPUT_JSON")+ if [ -z "$tag" ]; then+ echo "No ${{ env.GHCR_REPO }} tag found in DOCKER_METADATA_OUTPUT_JSON:"+ echo "$DOCKER_METADATA_OUTPUT_JSON"+ exit 1+ fi+ digest=$(docker buildx imagetools inspect "$tag" --format '{{.Manifest.Digest}}')if [ -z "$digest" ]; then- echo "No digest found in imagetools output:"- cat /tmp/push-ghcr.out+ echo "Could not resolve a manifest digest for $tag"exit 1fi- echo "digest=$digest" >> $GITHUB_OUTPUT+ echo "Attesting $tag@$digest"+ echo "digest=$digest" >> "$GITHUB_OUTPUT"- name: Attest GHCR imagesuses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8@@ -241,14 +249,22 @@ jobs:run: |set -euo pipefaildocker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \- $(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *) 2>&1 | tee /tmp/push-dockerhub.out- digest=$(grep -oE 'sha256:[a-f0-9]{64}' /tmp/push-dockerhub.out | head -n1 || true)+ $(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *)+ tag=$(jq -r --arg repo "${{ env.DOCKERHUB_REPO }}" \+ '[.tags[] | select(ascii_downcase | startswith(($repo | ascii_downcase) + ":"))][0] // ""' \+ <<< "$DOCKER_METADATA_OUTPUT_JSON")+ if [ -z "$tag" ]; then+ echo "No ${{ env.DOCKERHUB_REPO }} tag found in DOCKER_METADATA_OUTPUT_JSON:"+ echo "$DOCKER_METADATA_OUTPUT_JSON"+ exit 1+ fi+ digest=$(docker buildx imagetools inspect "$tag" --format '{{.Manifest.Digest}}')if [ -z "$digest" ]; then- echo "No digest found in imagetools output:"- cat /tmp/push-dockerhub.out+ echo "Could not resolve a manifest digest for $tag"exit 1fi- echo "digest=$digest" >> $GITHUB_OUTPUT+ echo "Attesting $tag@$digest"+ echo "digest=$digest" >> "$GITHUB_OUTPUT"- name: Attest Dockerhub imagesuses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8diff --git a/.github/workflows/docker-publish-rootless.yaml b/.github/workflows/docker-publish-rootless.yamlindex 900001fd..9141e46c 100644--- a/.github/workflows/docker-publish-rootless.yaml+++ b/.github/workflows/docker-publish-rootless.yaml@@ -219,14 +219,22 @@ jobs:run: |set -euo pipefaildocker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \- $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *) 2>&1 | tee /tmp/push-ghcr.out- digest=$(grep -oE 'sha256:[a-f0-9]{64}' /tmp/push-ghcr.out | head -n1 || true)+ $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *)+ tag=$(jq -r --arg repo "${{ env.GHCR_REPO }}" \+ '[.tags[] | select(ascii_downcase | startswith(($repo | ascii_downcase) + ":"))][0] // ""' \+ <<< "$DOCKER_METADATA_OUTPUT_JSON")+ if [ -z "$tag" ]; then+ echo "No ${{ env.GHCR_REPO }} tag found in DOCKER_METADATA_OUTPUT_JSON:"+ echo "$DOCKER_METADATA_OUTPUT_JSON"+ exit 1+ fi+ digest=$(docker buildx imagetools inspect "$tag" --format '{{.Manifest.Digest}}')if [ -z "$digest" ]; then- echo "No digest found in imagetools output:"- cat /tmp/push-ghcr.out+ echo "Could not resolve a manifest digest for $tag"exit 1fi- echo "digest=$digest" >> $GITHUB_OUTPUT+ echo "Attesting $tag@$digest"+ echo "digest=$digest" >> "$GITHUB_OUTPUT"- name: Attest GHCR imagesuses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8@@ -243,14 +251,22 @@ jobs:run: |set -euo pipefaildocker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \- $(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *) 2>&1 | tee /tmp/push-dockerhub.out- digest=$(grep -oE 'sha256:[a-f0-9]{64}' /tmp/push-dockerhub.out | head -n1 || true)+ $(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *)+ tag=$(jq -r --arg repo "${{ env.DOCKERHUB_REPO }}" \+ '[.tags[] | select(ascii_downcase | startswith(($repo | ascii_downcase) + ":"))][0] // ""' \+ <<< "$DOCKER_METADATA_OUTPUT_JSON")+ if [ -z "$tag" ]; then+ echo "No ${{ env.DOCKERHUB_REPO }} tag found in DOCKER_METADATA_OUTPUT_JSON:"+ echo "$DOCKER_METADATA_OUTPUT_JSON"+ exit 1+ fi+ digest=$(docker buildx imagetools inspect "$tag" --format '{{.Manifest.Digest}}')if [ -z "$digest" ]; then- echo "No digest found in imagetools output:"- cat /tmp/push-dockerhub.out+ echo "Could not resolve a manifest digest for $tag"exit 1fi- echo "digest=$digest" >> $GITHUB_OUTPUT+ echo "Attesting $tag@$digest"+ echo "digest=$digest" >> "$GITHUB_OUTPUT"- name: Attest Dockerhub imagesuses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8diff --git a/.github/workflows/docker-publish.yaml b/.github/workflows/docker-publish.yamlindex f25cb80a..4bc51dd6 100644--- a/.github/workflows/docker-publish.yaml+++ b/.github/workflows/docker-publish.yaml@@ -216,14 +216,22 @@ jobs:run: |set -euo pipefaildocker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \- $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *) 2>&1 | tee /tmp/push-ghcr.out- digest=$(grep -oE 'sha256:[a-f0-9]{64}' /tmp/push-ghcr.out | head -n1 || true)+ $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *)+ tag=$(jq -r --arg repo "${{ env.GHCR_REPO }}" \+ '[.tags[] | select(ascii_downcase | startswith(($repo | ascii_downcase) + ":"))][0] // ""' \+ <<< "$DOCKER_METADATA_OUTPUT_JSON")+ if [ -z "$tag" ]; then+ echo "No ${{ env.GHCR_REPO }} tag found in DOCKER_METADATA_OUTPUT_JSON:"+ echo "$DOCKER_METADATA_OUTPUT_JSON"+ exit 1+ fi+ digest=$(docker buildx imagetools inspect "$tag" --format '{{.Manifest.Digest}}')if [ -z "$digest" ]; then- echo "No digest found in imagetools output:"- cat /tmp/push-ghcr.out+ echo "Could not resolve a manifest digest for $tag"exit 1fi- echo "digest=$digest" >> $GITHUB_OUTPUT+ echo "Attesting $tag@$digest"+ echo "digest=$digest" >> "$GITHUB_OUTPUT"- name: Attest GHCR imagesuses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8@@ -240,14 +248,22 @@ jobs:run: |set -euo pipefaildocker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \- $(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *) 2>&1 | tee /tmp/push-dockerhub.out- digest=$(grep -oE 'sha256:[a-f0-9]{64}' /tmp/push-dockerhub.out | head -n1 || true)+ $(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *)+ tag=$(jq -r --arg repo "${{ env.DOCKERHUB_REPO }}" \+ '[.tags[] | select(ascii_downcase | startswith(($repo | ascii_downcase) + ":"))][0] // ""' \+ <<< "$DOCKER_METADATA_OUTPUT_JSON")+ if [ -z "$tag" ]; then+ echo "No ${{ env.DOCKERHUB_REPO }} tag found in DOCKER_METADATA_OUTPUT_JSON:"+ echo "$DOCKER_METADATA_OUTPUT_JSON"+ exit 1+ fi+ digest=$(docker buildx imagetools inspect "$tag" --format '{{.Manifest.Digest}}')if [ -z "$digest" ]; then- echo "No digest found in imagetools output:"- cat /tmp/push-dockerhub.out+ echo "Could not resolve a manifest digest for $tag"exit 1fi- echo "digest=$digest" >> $GITHUB_OUTPUT+ echo "Attesting $tag@$digest"+ echo "digest=$digest" >> "$GITHUB_OUTPUT"- name: Attest Dockerhub imagesuses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8