@@ -152,7 +152,7 @@ jobs:
152152 outputs :
153153 includes : ${{ steps.set.outputs.includes }}
154154 sign : ${{ steps.set.outputs.sign }}
155- privateRepo : ${{ steps.set.outputs.privateRepo }}
155+ ghaCacheSign : ${{ steps.set.outputs.ghaCacheSign }}
156156 steps :
157157 -
158158 name : Install @docker/actions-toolkit
@@ -162,13 +162,17 @@ jobs:
162162 with :
163163 script : |
164164 await exec.exec('npm', ['install', '--prefer-offline', '--ignore-scripts', core.getInput('dat-module')]);
165+ -
166+ name : Expose GitHub Runtime
167+ uses : crazy-max/ghaction-github-runtime@3cb05d89e1f492524af3d41a1c98c83bc3025124 # v3.1.0
165168 -
166169 name : Set outputs
167170 id : set
168171 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
169172 env :
170173 INPUT_SBOM-IMAGE : ${{ env.SBOM_IMAGE }}
171174 INPUT_MATRIX-SIZE-LIMIT : ${{ env.MATRIX_SIZE_LIMIT }}
175+ INPUT_ACTIONS-ID-TOKEN-SET : ${{ env.ACTIONS_ID_TOKEN_REQUEST_TOKEN != '' && env.ACTIONS_ID_TOKEN_REQUEST_URL != '' }}
172176 INPUT_RUNNER : ${{ inputs.runner }}
173177 INPUT_ARTIFACT-UPLOAD : ${{ inputs.artifact-upload }}
174178 INPUT_CONTEXT : ${{ inputs.context }}
@@ -189,6 +193,7 @@ jobs:
189193
190194 const inpSbomImage = core.getInput('sbom-image');
191195 const inpMatrixSizeLimit = parseInt(core.getInput('matrix-size-limit'), 10);
196+ const inpActionsIdTokenSet = core.getBooleanInput('actions-id-token-set');
192197
193198 const inpRunner = core.getInput('runner');
194199 const inpArtifactUpload = core.getBooleanInput('artifact-upload');
@@ -294,6 +299,11 @@ jobs:
294299 core.info(`sign: ${sign}`);
295300 core.setOutput('sign', sign);
296301 });
302+ await core.group(`Set ghaCacheSign output`, async () => {
303+ const ghaCacheSign = inpActionsIdTokenSet ? 'true' : 'false';
304+ core.info(`ghaCacheSign: ${ghaCacheSign}`);
305+ core.setOutput('ghaCacheSign', ghaCacheSign);
306+ });
297307
298308 build :
299309 runs-on : ${{ matrix.runner }}
@@ -373,9 +383,9 @@ jobs:
373383 [cache]
374384 [cache.gha]
375385 [cache.gha.sign]
376- command = ["ghacache-sign-script.sh"]
386+ command = [${{ needs.prepare.outputs.ghaCacheSign == 'true' && ' "ghacache-sign-script.sh"' || '' }} ]
377387 [cache.gha.verify]
378- required = true
388+ required = ${{ needs.prepare.outputs.ghaCacheSign }}
379389 [cache.gha.verify.policy]
380390 timestampThreshold = 1
381391 tlogThreshold = ${{ needs.prepare.outputs.privateRepo == 'true' && '0' || '1' }}
0 commit comments