File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 1515
1616if [[ -f " ${DIST_DIR} /checksums.txt.sig" && -f " ${DIST_DIR} /checksums.txt.pem" ]]; then
1717 if command -v cosign > /dev/null 2>&1 ; then
18- cosign verify-blob --certificate " ${DIST_DIR} /checksums.txt.pem" --signature " ${DIST_DIR} /checksums.txt.sig" " ${DIST_DIR} /checksums.txt"
18+ verify_args=(
19+ verify-blob
20+ --certificate " ${DIST_DIR} /checksums.txt.pem"
21+ --signature " ${DIST_DIR} /checksums.txt.sig"
22+ )
23+
24+ cert_identity=" ${COSIGN_CERT_IDENTITY:- } "
25+ cert_issuer=" ${COSIGN_CERT_ISSUER:- } "
26+
27+ if [[ -z " ${cert_identity} " && -n " ${GITHUB_WORKFLOW_REF:- } " ]]; then
28+ cert_identity=" https://github.com/${GITHUB_WORKFLOW_REF} "
29+ fi
30+ if [[ -z " ${cert_issuer} " && -n " ${GITHUB_ACTIONS:- } " ]]; then
31+ cert_issuer=" https://token.actions.githubusercontent.com"
32+ fi
33+
34+ if [[ -n " ${cert_identity} " ]]; then
35+ verify_args+=(--certificate-identity " ${cert_identity} " )
36+ fi
37+ if [[ -n " ${cert_issuer} " ]]; then
38+ verify_args+=(--certificate-oidc-issuer " ${cert_issuer} " )
39+ fi
40+
41+ verify_args+=(" ${DIST_DIR} /checksums.txt" )
42+ cosign " ${verify_args[@]} "
1943 else
2044 echo " cosign not installed; skipping signature verification"
2145 fi
You can’t perform that action at this time.
0 commit comments