We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 24c8e13 + 3c0167c commit 238f3d4Copy full SHA for 238f3d4
private/oci/sign_and_push.bzl
@@ -11,8 +11,13 @@ tag="$(stamp "{TAG}")"
11
digest="$(cat {DIGEST})"
12
echo "Pushing $repository@$digest"
13
{CRANE} push {IMAGE} "$repository@$digest"
14
-{COSIGN} attest "$repository@$digest" --predicate "{SBOM}" --type "spdx" --yes
15
-{COSIGN} sign "$repository@$digest" --yes
+
+# Check for signature and skip signing/sbom if present
16
+if ! {COSIGN} verify "$repository@$digest" --certificate-oidc-issuer https://accounts.google.com --certificate-identity "${{KEYLESS}}" > /dev/null; then
17
+ {COSIGN} attest "$repository@$digest" --predicate "{SBOM}" --type "spdx" --yes
18
+ {COSIGN} sign "$repository@$digest" --yes
19
+fi
20
21
{CRANE} tag "$repository@$digest" "$tag"
22
"""
23
0 commit comments