| 149 | } |
| 150 | |
| 151 | function checkVerifySteps( |
| 152 | fm: ParsedFrontmatter, |
| 153 | issues: ValidationIssue[] |
| 154 | ): void { |
| 155 | const field = fm.fields.get("verify"); |
| 156 | if (!field) return; |
| 157 | |
| 158 | const val = field.value; |
| 159 | if (!Array.isArray(val)) return; |
| 160 | |
| 161 | for (let i = 0; i < val.length; i++) { |
| 162 | const step = val[i]; |
| 163 | if (!step || typeof step !== "object") continue; |
| 164 | |
| 165 | const rec = step as Record<string, unknown>; |
| 166 | |
| 167 | if (!rec.type || rec.type === "") { |
| 168 | issues.push({ |
| 169 | severity: "error", |
| 170 | message: `verify[${i}]: missing required field 'type'`, |
| 171 | field: "verify", |
| 172 | target: "value", |
| 173 | }); |
| 174 | continue; |
| 175 | } |
| 176 | |
| 177 | if (rec.type === "bash" && (!rec.run || rec.run === "")) { |
| 178 | issues.push({ |
| 179 | severity: "error", |
| 180 | message: `verify[${i}]: bash step missing required field 'run'`, |
| 181 | field: "verify", |
| 182 | target: "value", |
| 183 | }); |
| 184 | } |
| 185 | |
| 186 | if (rec.type === "assert" && (!rec.check || rec.check === "")) { |
| 187 | issues.push({ |
| 188 | severity: "error", |
| 189 | message: `verify[${i}]: assert step missing required field 'check'`, |
| 190 | field: "verify", |
| 191 | target: "value", |
| 192 | }); |
| 193 | } |
| 194 | } |
| 195 | } |