@@ -14,24 +14,11 @@ limitations under the License.
1414import * as github from "@actions/github" ;
1515import * as core from "@actions/core" ;
1616import * as process from "process" ;
17- import { sign } from "sigstore" ;
17+ import { sign , verify } from "sigstore" ;
1818import * as tscommon from "tscommon" ;
1919
2020async function run ( ) : Promise < void > {
2121 try {
22- /* Test locally:
23- $ env INPUT_SLSA-WORKFLOW-RECIPIENT="laurentsimon/slsa-delegated-tool" \
24- INPUT_SLSA-REKOR-LOG-PUBLIC=true \
25- INPUT_SLSA-RUNNER-LABEL="ubuntu-latest" \
26- INPUT_SLSA-BUILD-ACTION-PATH="./actions/build-artifacts-composite" \
27- INPUT_SLSA-WORKFLOW-INPUTS="{\"name1\":\"value1\",\"name2\":\"value2\",\"name3\":\"value3\",\"name4\":\"value4\"}" \
28- INPUT_SLSA-WORKFLOW-INPUTS-MASK="name2, name4" \
29- INPUT_SLSA-CHECKOUT-FETCH-DEPTH="2" \
30- INPUT_SLSA-CHECKOUT-REPOSITORY-SHA1="abcdef" \
31- INPUT_SLSA-VERSION="v1" \
32- nodejs ./dist/index.js
33- */
34-
3522 const slsaVersion = core . getInput ( "slsa-version" ) ;
3623 if ( ! [ "v1.0" , "v0.2" ] . includes ( slsaVersion ) ) {
3724 throw new Error ( `Unsupported slsa-version: ${ slsaVersion } ` ) ;
@@ -121,6 +108,8 @@ async function run(): Promise<void> {
121108 } ,
122109 } ;
123110
111+ core . debug ( "here" ) ;
112+
124113 // Prepare the base64 unsigned token.
125114 const unsignedToken = JSON . stringify ( unsignedSlsaToken , undefined ) ;
126115 const unsignedB64Token = Buffer . from ( unsignedToken ) . toString ( "base64" ) ;
@@ -132,8 +121,7 @@ async function run(): Promise<void> {
132121
133122 // Verify just to double check.
134123 // NOTE: this is an offline verification.
135- // TODO(#1668): re-enable verification.
136- // await sigstore.verify(bundle, Buffer.from(unsignedB64Token));
124+ await verify ( bundle , Buffer . from ( unsignedB64Token ) ) ;
137125 const bundleStr = JSON . stringify ( bundle ) ;
138126
139127 const bundleB64 = Buffer . from ( bundleStr ) . toString ( "base64" ) ;
0 commit comments