fix(cicd): show PaC apply API errors

This commit is contained in:
Codex
2026-07-08 21:00:26 +02:00
parent 790c588e00
commit 95bc26fffa
2 changed files with 15 additions and 22 deletions
@@ -1008,12 +1008,14 @@ function renderPlan(result: Record<string, unknown>): RenderedCliResult {
function renderApply(result: Record<string, unknown>): RenderedCliResult {
const target = record(result.target);
const remote = record(result.remote);
const errorText = compactLine(stringValue(remote.stderrTail, stringValue(remote.error, stringValue(result.error, ""))));
const lines = [
"PLATFORM-INFRA PIPELINES-AS-CODE APPLY",
...table(["TARGET", "MODE", "MUTATION", "OK"], [[stringValue(target.id), stringValue(result.mode), boolText(result.mutation), boolText(result.ok)]]),
"",
"REMOTE",
...table(["CONTROLLER", "WEBHOOK", "REPOSITORY", "VALUES"], [[stringValue(remote.controllerReady), stringValue(record(remote.webhook).present), stringValue(remote.repository), "false"]]),
...table(["CONTROLLER", "WEBHOOK", "REPOSITORY", "EXIT", "VALUES"], [[stringValue(remote.controllerReady), stringValue(record(remote.webhook).present), stringValue(remote.repository), stringValue(remote.exitCode, "0"), "false"]]),
...(result.ok === false && errorText.length > 0 ? ["", `ERROR ${errorText}`] : []),
"",
"NEXT",
` status: ${stringValue(record(result.next).status)}`,