@@ -119,6 +119,10 @@ describe("minimal npm extended-stable workflow", () => {
119119 parsed . jobs ?. preflight_openclaw_npm ,
120120 "Checkout trusted Plugin SDK API tooling" ,
121121 ) ;
122+ const publishProvenanceRun = publishProvenance . run ;
123+ if ( ! publishProvenanceRun ) {
124+ throw new Error ( "Verify prepared tarball provenance is missing its run script" ) ;
125+ }
122126
123127 expect ( input ) . toEqual ( {
124128 default : "" ,
@@ -141,28 +145,28 @@ describe("minimal npm extended-stable workflow", () => {
141145 expect ( preflightDiff . run ) . toContain ( 'git -C "$tooling_dir" status --porcelain' ) ;
142146 expect ( preflightDiff . run ) . not . toContain ( 'pkg.scripts?.["plugin-sdk:api:diff"]' ) ;
143147 expect ( preflightDiff . run ) . toContain ( 'pnpm --dir "$tooling_dir" run plugin-sdk:api:diff' ) ;
144- expect ( publishProvenance . run ) . toContain ( "plugin-sdk-api-release-evidence.mjs" ) ;
145- expect ( publishProvenance . run ) . toContain ( '--acknowledge "$PLUGIN_SDK_API_ACKNOWLEDGEMENT"' ) ;
146- expect ( publishProvenance . run ) . toContain ( 'npm view "openclaw@${RELEASE_NPM_DIST_TAG}" version' ) ;
147- expect ( publishProvenance . run ) . toContain (
148+ expect ( publishProvenanceRun ) . toContain ( "plugin-sdk-api-release-evidence.mjs" ) ;
149+ expect ( publishProvenanceRun ) . toContain ( '--acknowledge "$PLUGIN_SDK_API_ACKNOWLEDGEMENT"' ) ;
150+ expect ( publishProvenanceRun ) . toContain ( 'npm view "openclaw@${RELEASE_NPM_DIST_TAG}" version' ) ;
151+ expect ( publishProvenanceRun ) . toContain (
148152 'git -C trusted-workflow rev-parse --verify "refs/tags/${current_selector_ref}^{commit}"' ,
149153 ) ;
150- expect ( publishProvenance . run ) . not . toContain ( "git fetch" ) ;
151- expect ( publishProvenance . run ) . toContain ( '--current-selector-ref "$current_selector_ref"' ) ;
152- expect ( publishProvenance . run ) . toContain ( '--current-selector-sha "$current_selector_sha"' ) ;
153- expect ( publishProvenance . run ) . toContain ( '--workflow-sha "$PREFLIGHT_WORKFLOW_SHA"' ) ;
154+ expect ( publishProvenanceRun ) . not . toContain ( "git fetch" ) ;
155+ expect ( publishProvenanceRun ) . toContain ( '--current-selector-ref "$current_selector_ref"' ) ;
156+ expect ( publishProvenanceRun ) . toContain ( '--current-selector-sha "$current_selector_sha"' ) ;
157+ expect ( publishProvenanceRun ) . toContain ( '--workflow-sha "$PREFLIGHT_WORKFLOW_SHA"' ) ;
154158 expect ( downloadPreflight . run ) . toContain (
155159 '"plugin-sdk-api-release-diff-${PREFLIGHT_RUN_ID}-${PREFLIGHT_RUN_ATTEMPT}"' ,
156160 ) ;
157- expect ( publishProvenance . run ) . toContain (
161+ expect ( publishProvenanceRun ) . toContain (
158162 "Prepared Plugin SDK API evidence does not match its immutable artifact" ,
159163 ) ;
160164 expect (
161- publishProvenance . run . indexOf (
165+ publishProvenanceRun . indexOf (
162166 "Prepared Plugin SDK API evidence does not match its immutable artifact" ,
163167 ) ,
164168 ) . toBeLessThan (
165- publishProvenance . run . indexOf ( 'npm view "openclaw@${RELEASE_NPM_DIST_TAG}" version' ) ,
169+ publishProvenanceRun . indexOf ( 'npm view "openclaw@${RELEASE_NPM_DIST_TAG}" version' ) ,
166170 ) ;
167171 expect ( verifyPreflightRun . run ) . toContain (
168172 '"$preflight_head_branch" == "$EXPECTED_EXTENDED_STABLE_BRANCH"' ,
0 commit comments