8282 tags : ${{ steps.meta.outputs.tags }}
8383 labels : ${{ steps.meta.outputs.labels }}
8484 provenance : true
85- sbom : true
85+ # SBOM is produced downstream by anchore/sbom-action and attached
86+ # as a cosign attestation, so skip the buildx-embedded SBOM to
87+ # avoid two different SBOMs against the same digest.
88+ sbom : false
8689 cache-from : type=gha
8790 cache-to : type=gha,mode=max
8891
@@ -92,11 +95,10 @@ jobs:
9295 - name : Cosign keyless sign
9396 env :
9497 DIGEST : ${{ steps.build.outputs.digest }}
95- TAGS : ${{ steps.meta.outputs.tags }}
96- run : |
97- for tag in $TAGS; do
98- cosign sign --yes "${tag}@${DIGEST}"
99- done
98+ IMAGE : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
99+ # All tags point at the same digest; sign the digest once rather
100+ # than re-signing it per tag.
101+ run : cosign sign --yes "${IMAGE}@${DIGEST}"
100102
101103 - name : Generate SBOM (SPDX)
102104 uses : anchore/sbom-action@v0
@@ -142,10 +144,24 @@ jobs:
142144 --username ${{ github.actor }} --password-stdin
143145
144146 - name : Push Helm chart (OCI)
147+ id : chart_push
145148 run : |
146149 version="${{ steps.ver.outputs.version }}"
150+ # helm push prints "Digest: sha256:..." to stderr; tee to capture.
147151 helm push "gpu-node-vsphere-maintenance-controller-${version}.tgz" \
148- "oci://${{ env.CHART_REPO }}"
152+ "oci://${{ env.CHART_REPO }}" 2>&1 | tee push.log
153+ digest=$(awk '/^Digest: /{print $2}' push.log)
154+ if [ -z "$digest" ]; then
155+ echo "Failed to capture chart digest" >&2
156+ exit 1
157+ fi
158+ echo "digest=${digest}" >> "$GITHUB_OUTPUT"
159+
160+ - name : Cosign keyless sign (chart)
161+ env :
162+ DIGEST : ${{ steps.chart_push.outputs.digest }}
163+ CHART_REF : ${{ env.CHART_REPO }}/gpu-node-vsphere-maintenance-controller
164+ run : cosign sign --yes "${CHART_REF}@${DIGEST}"
149165
150166 - name : Create GitHub Release
151167 uses : softprops/action-gh-release@v2
0 commit comments