CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix(ci): the runner executed "|" instead of every multi-line script — block scalars now parsed #5466

Merged⚡ AI-generatedXSccantynz wants to mergefix/workflow-runner-block-scalarsmainopened 24d ago
1 changed file+40−1
Modifiedsrc/lib/workflow-parser-ext.ts+40−1View fileUnifiedSplit
518518 if (sk === "id") stepExt.id = String(parseScalar(sv));
519519 else if (sk === "name") stepExt.name = String(parseScalar(sv));
520520 else if (sk === "if") stepExt.if = sv.trim();
521 else if (sk === "run") stepExt.run = String(parseScalar(sv));
521 else if (sk === "run") {
522 // ROOT CAUSE OF EVERY ~500ms CI FAILURE (2026-08-08): this
523 // parser had no block-scalar handling, so `run: |` parsed
524 // to the literal string "|" — and the merge below spreads
525 // ext AFTER base, so this clobbered the base parser's
526 // CORRECT multi-line script. Every multi-line `run:` step
527 // on the platform executed `bash -c '|'` → instant syntax
528 // error. 254 consecutive junk failures on the deploy
529 // workflow alone.
530 const marker = sv.trim();
531 if (
532 marker === "|" || marker === "|-" || marker === "|+" ||
533 marker === ">" || marker === ">-" || marker === ">+"
534 ) {
535 const bodyLines: Line[] = [];
536 let v = u + 1;
537 while (
538 v < stepBody.length &&
539 stepBody[v].indent > stepLine.indent
540 ) {
541 bodyLines.push(stepBody[v]);
542 v++;
543 }
544 const minIndent = bodyLines.length
545 ? Math.min(...bodyLines.map((l) => l.indent))
546 : 0;
547 const dedented = bodyLines.map((l) =>
548 l.raw.slice(minIndent).replace(/[\r\n]+$/, "")
549 );
550 const joined = marker.startsWith(">")
551 ? dedented.join(" ")
552 : dedented.join("\n");
553 stepExt.run = marker.endsWith("-")
554 ? joined.replace(/\n+$/, "")
555 : joined;
556 u = v - 1;
557 } else {
558 stepExt.run = String(parseScalar(sv));
559 }
560 }
522561 else if (sk === "uses") stepExt.uses = String(parseScalar(sv));
523562 else if (sk === "parallel") stepExt.parallel = parseScalar(sv) === true;
524563 else if (sk === "continue-on-error")
525564
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts