Skip to content

Commit 6455d86

Browse files
committed
fix(release): cosign v4 emits a single sigstore bundle
cosign v4 deprecates --output-signature / --output-certificate and writes a single .sigstore.json bundle via --bundle. without that flag the run crashes with "create bundle file: open : no such file or directory". emit `<tarball>.sigstore.json`, attach it to the github release, and teach verify.sh to fetch and verify against the bundle instead of the split .sig + .crt pair.
1 parent 00d0488 commit 6455d86

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ jobs:
134134
name: tarball
135135

136136
- name: sign
137+
# cosign v4 emits a single sigstore bundle (.sigstore.json) by default;
138+
# --output-signature / --output-certificate are deprecated and ignored.
137139
run: |
138140
cosign sign-blob --yes \
139-
--output-signature "${{ needs.build.outputs.tarball-name }}.sig" \
140-
--output-certificate "${{ needs.build.outputs.tarball-name }}.crt" \
141+
--bundle "${{ needs.build.outputs.tarball-name }}.sigstore.json" \
141142
"${{ needs.build.outputs.tarball-name }}"
142143
143144
- name: attach signature to release
144145
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
145146
with:
146147
files: |
147-
${{ needs.build.outputs.tarball-name }}.sig
148-
${{ needs.build.outputs.tarball-name }}.crt
148+
${{ needs.build.outputs.tarball-name }}.sigstore.json

scripts/verify.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,18 @@ TARBALL="$(cd "$WORK" && npm pack "$SPEC" --silent | tail -n 1)"
5454
gh release download "v${VERSION}" \
5555
-R "$GH_REPO" \
5656
-D "$WORK" \
57-
-p "${TARBALL}.sig" \
58-
-p "${TARBALL}.crt" \
57+
-p "${TARBALL}.sigstore.json" \
5958
-p "${TARBALL}.intoto.jsonl" 2>/dev/null || true
6059

61-
if [ ! -f "$WORK/${TARBALL}.sig" ] || [ ! -f "$WORK/${TARBALL}.crt" ]; then
62-
echo " missing ${TARBALL}.sig / .crt on github release v${VERSION} of ${GH_REPO}"
60+
if [ ! -f "$WORK/${TARBALL}.sigstore.json" ]; then
61+
echo " missing ${TARBALL}.sigstore.json on github release v${VERSION} of ${GH_REPO}"
6362
exit 1
6463
fi
6564

6665
cosign verify-blob \
6766
--certificate-identity-regexp "$EXPECTED_SUBJECT_REGEX" \
6867
--certificate-oidc-issuer "$EXPECTED_ISSUER" \
69-
--certificate "$WORK/${TARBALL}.crt" \
70-
--signature "$WORK/${TARBALL}.sig" \
68+
--bundle "$WORK/${TARBALL}.sigstore.json" \
7169
"$WORK/${TARBALL}"
7270
echo " ok"
7371

0 commit comments

Comments
 (0)