File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,7 +134,23 @@ jobs:
134134 }
135135 )
136136
137- $index | ConvertTo-Json -Depth 5 | Set-Content -Path $runtimeIndexPath -Encoding UTF8
137+ ConvertTo-Json -InputObject $index -Depth 5 | Set-Content -Path $runtimeIndexPath -Encoding UTF8
138+
139+ $env:RUNTIME_INDEX_PATH = $runtimeIndexPath
140+ $validateScript = @'
141+ import { readFileSync } from "node:fs";
142+
143+ const indexPath = process.env.RUNTIME_INDEX_PATH;
144+ if (!indexPath) {
145+ throw new Error("RUNTIME_INDEX_PATH is required");
146+ }
147+
148+ const value = JSON.parse(readFileSync(indexPath, "utf8"));
149+ if (!Array.isArray(value) || value.length !== 1) {
150+ throw new Error("runtime-release-index.json must contain exactly one release entry array");
151+ }
152+ '@
153+ node --input-type=module -e $validateScript
138154
139155 "runtime_zip_path=$runtimeZipPath" >> $env:GITHUB_OUTPUT
140156 "runtime_index_path=$runtimeIndexPath" >> $env:GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments