@@ -108,15 +108,30 @@ on:
108108 github-token :
109109 description : " GitHub Token used to authenticate against a repository for Git context"
110110 required : false
111+ outputs :
112+ cosign-version :
113+ description : Cosign version used for verification
114+ value : ${{ jobs.build.outputs.cosign-version }}
115+ cosign-verify-commands :
116+ description : Cosign verify commands
117+ value : ${{ jobs.build.outputs.cosign-verify-commands }}
118+ artifact-name :
119+ description : Name of the uploaded artifact (for local output)
120+ value : ${{ jobs.build.outputs.artifact-name }}
111121
112122env :
113123 DOCKER_ACTIONS_TOOLKIT_MODULE : " @docker/actions-toolkit@0.67.0"
114124 COSIGN_VERSION : " v3.0.2"
115125 LOCAL_EXPORT_DIR : " /tmp/buildx-output"
126+ LOCAL_ARTIFACT_NAME : " docker-github-builder-assets"
116127
117128jobs :
118129 build :
119130 runs-on : ubuntu-latest
131+ outputs :
132+ cosign-version : ${{ env.COSIGN_VERSION }}
133+ cosign-verify-commands : ${{ steps.signing-attestation-manifests.outputs.verify-commands || steps.signing-local-artifacts.outputs.verify-commands }}
134+ artifact-name : ${{ env.LOCAL_ARTIFACT_NAME }}
120135 permissions :
121136 contents : read
122137 id-token : write # needed for signing the images with GitHub OIDC Token
@@ -266,6 +281,7 @@ jobs:
266281 await cosign.printVersion();
267282 -
268283 name : Signing attestation manifests
284+ id : signing-attestation-manifests
269285 if : ${{ inputs.output == 'registry' }}
270286 uses : actions/github-script@v8
271287 env :
@@ -288,8 +304,19 @@ jobs:
288304 { certificateIdentityRegexp: `^https://github.com/docker/github-builder-experimental/.github/workflows/build.yml.*$` },
289305 signResults
290306 );
307+
308+ await core.group(`Verify commands`, async () => {
309+ const verifyCommands = [];
310+ for (const [attestationRef, verifyResult] of Object.entries(verifyResults)) {
311+ const cmd = `cosign ${verifyResult.cosignArgs.join(' ')} ${attestationRef}`;
312+ core.info(cmd);
313+ verifyCommands.push(cmd);
314+ }
315+ core.setOutput('verify-commands', verifyCommands.join('\n'));
316+ });
291317 -
292318 name : Signing local artifacts
319+ id : signing-local-artifacts
293320 if : ${{ inputs.output == 'local' }}
294321 uses : actions/github-script@v8
295322 env :
@@ -309,6 +336,16 @@ jobs:
309336 { certificateIdentityRegexp: `^https://github.com/docker/github-builder-experimental/.github/workflows/build.yml.*$` },
310337 signResults
311338 );
339+
340+ await core.group(`Verify commands`, async () => {
341+ const verifyCommands = [];
342+ for (const [artifactPath, verifyResult] of Object.entries(verifyResults)) {
343+ const cmd = `cosign ${verifyResult.cosignArgs.join(' ')} --bundle ${path.relative(inplocalExportDir, verifyResult.bundlePath)} ${path.relative(inplocalExportDir, artifactPath)}`;
344+ core.info(cmd);
345+ verifyCommands.push(cmd);
346+ }
347+ core.setOutput('verify-commands', verifyCommands.join('\n'));
348+ });
312349 -
313350 name : Create manifest
314351 if : ${{ inputs.output == 'registry' }}
@@ -343,6 +380,6 @@ jobs:
343380 if : ${{ inputs.output == 'local' }}
344381 uses : actions/upload-artifact@v5
345382 with :
346- name : docker-github-builder-assets
383+ name : ${{ env.LOCAL_ARTIFACT_NAME }}
347384 path : ${{ env.LOCAL_EXPORT_DIR }}
348385 if-no-files-found : error
0 commit comments