@@ -124,28 +124,30 @@ jobs:
124124 annotations : ${{ inputs.set-meta-annotations && steps.meta.outputs.annotations || '' }}
125125 github-token : ${{ secrets.github-token || github.token }}
126126 -
127- name : Get attestations digest
127+ name : Get attestations manifest digest
128128 id : attest
129129 uses : actions/github-script@v7
130130 env :
131131 INPUT_IMAGE-NAME : ${{ inputs.meta-image }}
132132 INPUT_IMAGE-DIGEST : ${{ steps.build.outputs.digest }}
133133 with :
134134 script : |
135- await core.group(`Get attestations digest`, async () => {
135+ let manifest = {};
136+ await core.group(`Get manifest`, async () => {
136137 await exec.getExecOutput('docker', ['buildx', 'imagetools', 'inspect', `${core.getInput('image-name')}@${core.getInput('image-digest')}`, '--format', '{{json .Manifest}}'], {
137- ignoreReturnCode: true,
138- silent: true
138+ ignoreReturnCode: true
139139 }).then(res => {
140140 if (res.stderr.length > 0 && res.exitCode != 0) {
141141 throw new Error(res.stderr);
142142 }
143- const dt = JSON.parse(res.stdout.trim());
144- const attestationDigests = dt.manifests.filter(m => m.annotations && m.annotations['vnd.docker.reference.type'] === 'attestation-manifest').map(m => m.digest);
145- core.info(JSON.stringify(attestationDigests, null, 2));
146- core.setOutput('digests', attestationDigests.join('\n'));
143+ manifest = JSON.parse(res.stdout.trim());
147144 });
148145 });
146+ await core.group(`Get attestations manifest digest`, async () => {
147+ const attestationDigests = manifest.manifests.filter(m => m.annotations && m.annotations['vnd.docker.reference.type'] === 'attestation-manifest').map(m => m.digest);
148+ core.info(JSON.stringify(attestationDigests, null, 2));
149+ core.setOutput('digests', attestationDigests.join('\n'));
150+ });
149151 -
150152 name : Install cosign
151153 if : ${{ inputs.push }}
0 commit comments