From 28728d54030cb4d35a8a7e5188b39865c4da645c Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 9 Sep 2025 22:42:48 +0100 Subject: [PATCH 1/3] fix showing prompt in job report --- .github/workflows/test-ai-inference-github-models.lock.yml | 2 ++ .github/workflows/test-claude-add-issue-comment.lock.yml | 2 ++ .github/workflows/test-claude-add-issue-labels.lock.yml | 2 ++ .github/workflows/test-claude-command.lock.yml | 2 ++ .github/workflows/test-claude-create-issue.lock.yml | 2 ++ .../test-claude-create-pull-request-review-comment.lock.yml | 2 ++ .github/workflows/test-claude-create-pull-request.lock.yml | 2 ++ .github/workflows/test-claude-create-security-report.lock.yml | 2 ++ .github/workflows/test-claude-mcp.lock.yml | 2 ++ .github/workflows/test-claude-push-to-branch.lock.yml | 2 ++ .github/workflows/test-claude-update-issue.lock.yml | 2 ++ .github/workflows/test-codex-add-issue-comment.lock.yml | 2 ++ .github/workflows/test-codex-add-issue-labels.lock.yml | 2 ++ .github/workflows/test-codex-command.lock.yml | 2 ++ .github/workflows/test-codex-create-issue.lock.yml | 2 ++ .../test-codex-create-pull-request-review-comment.lock.yml | 2 ++ .github/workflows/test-codex-create-pull-request.lock.yml | 2 ++ .github/workflows/test-codex-create-security-report.lock.yml | 2 ++ .github/workflows/test-codex-mcp.lock.yml | 2 ++ .github/workflows/test-codex-push-to-branch.lock.yml | 2 ++ .github/workflows/test-codex-update-issue.lock.yml | 2 ++ .../workflows/test-example-engine-network-permissions.lock.yml | 2 ++ .github/workflows/test-proxy.lock.yml | 2 ++ .github/workflows/test-safe-outputs-custom-engine.lock.yml | 2 ++ pkg/workflow/compiler.go | 2 ++ 25 files changed, 50 insertions(+) diff --git a/.github/workflows/test-ai-inference-github-models.lock.yml b/.github/workflows/test-ai-inference-github-models.lock.yml index 13a2c29cc21..d3fd7d9a10f 100644 --- a/.github/workflows/test-ai-inference-github-models.lock.yml +++ b/.github/workflows/test-ai-inference-github-models.lock.yml @@ -413,6 +413,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-claude-add-issue-comment.lock.yml b/.github/workflows/test-claude-add-issue-comment.lock.yml index 42f827ad8a1..5a3dc0d722f 100644 --- a/.github/workflows/test-claude-add-issue-comment.lock.yml +++ b/.github/workflows/test-claude-add-issue-comment.lock.yml @@ -555,6 +555,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-claude-add-issue-labels.lock.yml b/.github/workflows/test-claude-add-issue-labels.lock.yml index 2d6587bc4ed..e1db0eadf49 100644 --- a/.github/workflows/test-claude-add-issue-labels.lock.yml +++ b/.github/workflows/test-claude-add-issue-labels.lock.yml @@ -555,6 +555,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-claude-command.lock.yml b/.github/workflows/test-claude-command.lock.yml index b1bdf9e9784..91291b34f11 100644 --- a/.github/workflows/test-claude-command.lock.yml +++ b/.github/workflows/test-claude-command.lock.yml @@ -728,6 +728,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-claude-create-issue.lock.yml b/.github/workflows/test-claude-create-issue.lock.yml index 3fc6e83b20f..4b596d48aee 100644 --- a/.github/workflows/test-claude-create-issue.lock.yml +++ b/.github/workflows/test-claude-create-issue.lock.yml @@ -228,6 +228,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-claude-create-pull-request-review-comment.lock.yml b/.github/workflows/test-claude-create-pull-request-review-comment.lock.yml index 2a4dbe62f1b..4e507a2b30d 100644 --- a/.github/workflows/test-claude-create-pull-request-review-comment.lock.yml +++ b/.github/workflows/test-claude-create-pull-request-review-comment.lock.yml @@ -501,6 +501,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-claude-create-pull-request.lock.yml b/.github/workflows/test-claude-create-pull-request.lock.yml index bf44be215d7..ec613f0eaa0 100644 --- a/.github/workflows/test-claude-create-pull-request.lock.yml +++ b/.github/workflows/test-claude-create-pull-request.lock.yml @@ -240,6 +240,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-claude-create-security-report.lock.yml b/.github/workflows/test-claude-create-security-report.lock.yml index 6a72feb3a9d..5432a5da6b7 100644 --- a/.github/workflows/test-claude-create-security-report.lock.yml +++ b/.github/workflows/test-claude-create-security-report.lock.yml @@ -494,6 +494,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-claude-mcp.lock.yml b/.github/workflows/test-claude-mcp.lock.yml index 3097f70a61f..eb0ee33ce6f 100644 --- a/.github/workflows/test-claude-mcp.lock.yml +++ b/.github/workflows/test-claude-mcp.lock.yml @@ -509,6 +509,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-claude-push-to-branch.lock.yml b/.github/workflows/test-claude-push-to-branch.lock.yml index 07f46a72a75..14b85c1240f 100644 --- a/.github/workflows/test-claude-push-to-branch.lock.yml +++ b/.github/workflows/test-claude-push-to-branch.lock.yml @@ -358,6 +358,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-claude-update-issue.lock.yml b/.github/workflows/test-claude-update-issue.lock.yml index cbb7c595cd6..2f9211563a2 100644 --- a/.github/workflows/test-claude-update-issue.lock.yml +++ b/.github/workflows/test-claude-update-issue.lock.yml @@ -558,6 +558,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-codex-add-issue-comment.lock.yml b/.github/workflows/test-codex-add-issue-comment.lock.yml index f513ea9efe7..42383651ef3 100644 --- a/.github/workflows/test-codex-add-issue-comment.lock.yml +++ b/.github/workflows/test-codex-add-issue-comment.lock.yml @@ -449,6 +449,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-codex-add-issue-labels.lock.yml b/.github/workflows/test-codex-add-issue-labels.lock.yml index fb2a1fc30f7..3dd406b8843 100644 --- a/.github/workflows/test-codex-add-issue-labels.lock.yml +++ b/.github/workflows/test-codex-add-issue-labels.lock.yml @@ -449,6 +449,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-codex-command.lock.yml b/.github/workflows/test-codex-command.lock.yml index 44bde24c9cd..b8efa9a6be2 100644 --- a/.github/workflows/test-codex-command.lock.yml +++ b/.github/workflows/test-codex-command.lock.yml @@ -728,6 +728,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-codex-create-issue.lock.yml b/.github/workflows/test-codex-create-issue.lock.yml index 0dbe8c4db6f..52e49f7e2f1 100644 --- a/.github/workflows/test-codex-create-issue.lock.yml +++ b/.github/workflows/test-codex-create-issue.lock.yml @@ -122,6 +122,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-codex-create-pull-request-review-comment.lock.yml b/.github/workflows/test-codex-create-pull-request-review-comment.lock.yml index 2ad6e689187..e08b9d3bb51 100644 --- a/.github/workflows/test-codex-create-pull-request-review-comment.lock.yml +++ b/.github/workflows/test-codex-create-pull-request-review-comment.lock.yml @@ -395,6 +395,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-codex-create-pull-request.lock.yml b/.github/workflows/test-codex-create-pull-request.lock.yml index 65401c4df24..7580b73bdda 100644 --- a/.github/workflows/test-codex-create-pull-request.lock.yml +++ b/.github/workflows/test-codex-create-pull-request.lock.yml @@ -134,6 +134,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-codex-create-security-report.lock.yml b/.github/workflows/test-codex-create-security-report.lock.yml index 1299fc60c56..acd7c5698c2 100644 --- a/.github/workflows/test-codex-create-security-report.lock.yml +++ b/.github/workflows/test-codex-create-security-report.lock.yml @@ -388,6 +388,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-codex-mcp.lock.yml b/.github/workflows/test-codex-mcp.lock.yml index e2197336203..a3ccda423cc 100644 --- a/.github/workflows/test-codex-mcp.lock.yml +++ b/.github/workflows/test-codex-mcp.lock.yml @@ -401,6 +401,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-codex-push-to-branch.lock.yml b/.github/workflows/test-codex-push-to-branch.lock.yml index b7a334f10e9..392efa441f4 100644 --- a/.github/workflows/test-codex-push-to-branch.lock.yml +++ b/.github/workflows/test-codex-push-to-branch.lock.yml @@ -254,6 +254,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-codex-update-issue.lock.yml b/.github/workflows/test-codex-update-issue.lock.yml index 7c41fdec1ce..93314f86358 100644 --- a/.github/workflows/test-codex-update-issue.lock.yml +++ b/.github/workflows/test-codex-update-issue.lock.yml @@ -452,6 +452,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-example-engine-network-permissions.lock.yml b/.github/workflows/test-example-engine-network-permissions.lock.yml index ee5bf6068fe..12f3196ec8b 100644 --- a/.github/workflows/test-example-engine-network-permissions.lock.yml +++ b/.github/workflows/test-example-engine-network-permissions.lock.yml @@ -249,6 +249,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-proxy.lock.yml b/.github/workflows/test-proxy.lock.yml index 79fe2330052..3badbce7b1e 100644 --- a/.github/workflows/test-proxy.lock.yml +++ b/.github/workflows/test-proxy.lock.yml @@ -470,6 +470,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/.github/workflows/test-safe-outputs-custom-engine.lock.yml b/.github/workflows/test-safe-outputs-custom-engine.lock.yml index c3fb3cc49a8..9557f7d5e3c 100644 --- a/.github/workflows/test-safe-outputs-custom-engine.lock.yml +++ b/.github/workflows/test-safe-outputs-custom-engine.lock.yml @@ -299,6 +299,8 @@ jobs: echo '``````markdown' >> $GITHUB_STEP_SUMMARY cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY echo '``````' >> $GITHUB_STEP_SUMMARY + env: + GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt - name: Generate agentic run info uses: actions/github-script@v7 with: diff --git a/pkg/workflow/compiler.go b/pkg/workflow/compiler.go index 9fd1aea66e9..55b560de8f4 100644 --- a/pkg/workflow/compiler.go +++ b/pkg/workflow/compiler.go @@ -3307,6 +3307,8 @@ func (c *Compiler) generatePrompt(yaml *strings.Builder, data *WorkflowData) { yaml.WriteString(" echo '``````markdown' >> $GITHUB_STEP_SUMMARY\n") yaml.WriteString(" cat $GITHUB_AW_PROMPT >> $GITHUB_STEP_SUMMARY\n") yaml.WriteString(" echo '``````' >> $GITHUB_STEP_SUMMARY\n") + yaml.WriteString(" env:\n") + yaml.WriteString(" GITHUB_AW_PROMPT: /tmp/aw-prompts/prompt.txt\n") } // generatePostSteps generates the post-steps section that runs after AI execution From 68cfc5741f8d524bfdb48e04978b323b1694f9c5 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 9 Sep 2025 23:36:00 +0100 Subject: [PATCH 2/3] fix emit --- .../test-ai-inference-github-models.lock.yml | 11 +++++++---- .../workflows/test-claude-add-issue-comment.lock.yml | 11 +++++++---- .../workflows/test-claude-add-issue-labels.lock.yml | 11 +++++++---- .github/workflows/test-claude-command.lock.yml | 11 +++++++---- .github/workflows/test-claude-create-issue.lock.yml | 11 +++++++---- ...laude-create-pull-request-review-comment.lock.yml | 11 +++++++---- .../test-claude-create-pull-request.lock.yml | 11 +++++++---- .../test-claude-create-security-report.lock.yml | 11 +++++++---- .github/workflows/test-claude-mcp.lock.yml | 11 +++++++---- .../workflows/test-claude-push-to-branch.lock.yml | 11 +++++++---- .github/workflows/test-claude-update-issue.lock.yml | 11 +++++++---- .../workflows/test-codex-add-issue-comment.lock.yml | 11 +++++++---- .../workflows/test-codex-add-issue-labels.lock.yml | 11 +++++++---- .github/workflows/test-codex-command.lock.yml | 11 +++++++---- .github/workflows/test-codex-create-issue.lock.yml | 11 +++++++---- ...codex-create-pull-request-review-comment.lock.yml | 11 +++++++---- .../test-codex-create-pull-request.lock.yml | 11 +++++++---- .../test-codex-create-security-report.lock.yml | 11 +++++++---- .github/workflows/test-codex-mcp.lock.yml | 11 +++++++---- .github/workflows/test-codex-push-to-branch.lock.yml | 11 +++++++---- .github/workflows/test-codex-update-issue.lock.yml | 11 +++++++---- .github/workflows/test-proxy.lock.yml | 11 +++++++---- .../test-safe-outputs-custom-engine.lock.yml | 11 +++++++---- pkg/workflow/js/collect_ndjson_output.cjs | 12 ++++++++---- 24 files changed, 169 insertions(+), 96 deletions(-) diff --git a/.github/workflows/test-ai-inference-github-models.lock.yml b/.github/workflows/test-ai-inference-github-models.lock.yml index d3fd7d9a10f..9990cfaeb19 100644 --- a/.github/workflows/test-ai-inference-github-models.lock.yml +++ b/.github/workflows/test-ai-inference-github-models.lock.yml @@ -741,11 +741,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1156,6 +1155,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-claude-add-issue-comment.lock.yml b/.github/workflows/test-claude-add-issue-comment.lock.yml index 5a3dc0d722f..dd848e6b608 100644 --- a/.github/workflows/test-claude-add-issue-comment.lock.yml +++ b/.github/workflows/test-claude-add-issue-comment.lock.yml @@ -928,11 +928,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1343,6 +1342,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-claude-add-issue-labels.lock.yml b/.github/workflows/test-claude-add-issue-labels.lock.yml index e1db0eadf49..f7b41d1f612 100644 --- a/.github/workflows/test-claude-add-issue-labels.lock.yml +++ b/.github/workflows/test-claude-add-issue-labels.lock.yml @@ -928,11 +928,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1343,6 +1342,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-claude-command.lock.yml b/.github/workflows/test-claude-command.lock.yml index 91291b34f11..724f7d22fb3 100644 --- a/.github/workflows/test-claude-command.lock.yml +++ b/.github/workflows/test-claude-command.lock.yml @@ -1101,11 +1101,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1516,6 +1515,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-claude-create-issue.lock.yml b/.github/workflows/test-claude-create-issue.lock.yml index 4b596d48aee..58d2682339f 100644 --- a/.github/workflows/test-claude-create-issue.lock.yml +++ b/.github/workflows/test-claude-create-issue.lock.yml @@ -601,11 +601,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1016,6 +1015,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-claude-create-pull-request-review-comment.lock.yml b/.github/workflows/test-claude-create-pull-request-review-comment.lock.yml index 4e507a2b30d..312a5c8842f 100644 --- a/.github/workflows/test-claude-create-pull-request-review-comment.lock.yml +++ b/.github/workflows/test-claude-create-pull-request-review-comment.lock.yml @@ -874,11 +874,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1289,6 +1288,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-claude-create-pull-request.lock.yml b/.github/workflows/test-claude-create-pull-request.lock.yml index ec613f0eaa0..2f0c90325a5 100644 --- a/.github/workflows/test-claude-create-pull-request.lock.yml +++ b/.github/workflows/test-claude-create-pull-request.lock.yml @@ -625,11 +625,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1040,6 +1039,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-claude-create-security-report.lock.yml b/.github/workflows/test-claude-create-security-report.lock.yml index 5432a5da6b7..a9d233cabcb 100644 --- a/.github/workflows/test-claude-create-security-report.lock.yml +++ b/.github/workflows/test-claude-create-security-report.lock.yml @@ -867,11 +867,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1282,6 +1281,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-claude-mcp.lock.yml b/.github/workflows/test-claude-mcp.lock.yml index eb0ee33ce6f..f4cd90b6f53 100644 --- a/.github/workflows/test-claude-mcp.lock.yml +++ b/.github/workflows/test-claude-mcp.lock.yml @@ -883,11 +883,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1298,6 +1297,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-claude-push-to-branch.lock.yml b/.github/workflows/test-claude-push-to-branch.lock.yml index 14b85c1240f..837ffdbf278 100644 --- a/.github/workflows/test-claude-push-to-branch.lock.yml +++ b/.github/workflows/test-claude-push-to-branch.lock.yml @@ -743,11 +743,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1158,6 +1157,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-claude-update-issue.lock.yml b/.github/workflows/test-claude-update-issue.lock.yml index 2f9211563a2..136662338af 100644 --- a/.github/workflows/test-claude-update-issue.lock.yml +++ b/.github/workflows/test-claude-update-issue.lock.yml @@ -931,11 +931,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1346,6 +1345,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-codex-add-issue-comment.lock.yml b/.github/workflows/test-codex-add-issue-comment.lock.yml index 42383651ef3..c0509885489 100644 --- a/.github/workflows/test-codex-add-issue-comment.lock.yml +++ b/.github/workflows/test-codex-add-issue-comment.lock.yml @@ -759,11 +759,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1174,6 +1173,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-codex-add-issue-labels.lock.yml b/.github/workflows/test-codex-add-issue-labels.lock.yml index 3dd406b8843..be5c350bd3f 100644 --- a/.github/workflows/test-codex-add-issue-labels.lock.yml +++ b/.github/workflows/test-codex-add-issue-labels.lock.yml @@ -759,11 +759,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1174,6 +1173,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-codex-command.lock.yml b/.github/workflows/test-codex-command.lock.yml index b8efa9a6be2..f98efef5b79 100644 --- a/.github/workflows/test-codex-command.lock.yml +++ b/.github/workflows/test-codex-command.lock.yml @@ -1101,11 +1101,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1516,6 +1515,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-codex-create-issue.lock.yml b/.github/workflows/test-codex-create-issue.lock.yml index 52e49f7e2f1..469040ae82f 100644 --- a/.github/workflows/test-codex-create-issue.lock.yml +++ b/.github/workflows/test-codex-create-issue.lock.yml @@ -432,11 +432,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -847,6 +846,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-codex-create-pull-request-review-comment.lock.yml b/.github/workflows/test-codex-create-pull-request-review-comment.lock.yml index e08b9d3bb51..42d811b18e2 100644 --- a/.github/workflows/test-codex-create-pull-request-review-comment.lock.yml +++ b/.github/workflows/test-codex-create-pull-request-review-comment.lock.yml @@ -705,11 +705,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1120,6 +1119,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-codex-create-pull-request.lock.yml b/.github/workflows/test-codex-create-pull-request.lock.yml index 7580b73bdda..46a77cdef5e 100644 --- a/.github/workflows/test-codex-create-pull-request.lock.yml +++ b/.github/workflows/test-codex-create-pull-request.lock.yml @@ -444,11 +444,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -859,6 +858,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-codex-create-security-report.lock.yml b/.github/workflows/test-codex-create-security-report.lock.yml index acd7c5698c2..8818e7aa70c 100644 --- a/.github/workflows/test-codex-create-security-report.lock.yml +++ b/.github/workflows/test-codex-create-security-report.lock.yml @@ -698,11 +698,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1113,6 +1112,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-codex-mcp.lock.yml b/.github/workflows/test-codex-mcp.lock.yml index a3ccda423cc..ab968d8c194 100644 --- a/.github/workflows/test-codex-mcp.lock.yml +++ b/.github/workflows/test-codex-mcp.lock.yml @@ -711,11 +711,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1126,6 +1125,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-codex-push-to-branch.lock.yml b/.github/workflows/test-codex-push-to-branch.lock.yml index 392efa441f4..e56905c5cf9 100644 --- a/.github/workflows/test-codex-push-to-branch.lock.yml +++ b/.github/workflows/test-codex-push-to-branch.lock.yml @@ -564,11 +564,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -979,6 +978,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-codex-update-issue.lock.yml b/.github/workflows/test-codex-update-issue.lock.yml index 93314f86358..ae2d5129879 100644 --- a/.github/workflows/test-codex-update-issue.lock.yml +++ b/.github/workflows/test-codex-update-issue.lock.yml @@ -762,11 +762,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1177,6 +1176,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-proxy.lock.yml b/.github/workflows/test-proxy.lock.yml index 3badbce7b1e..0df0c3d3a2a 100644 --- a/.github/workflows/test-proxy.lock.yml +++ b/.github/workflows/test-proxy.lock.yml @@ -844,11 +844,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1259,6 +1258,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/.github/workflows/test-safe-outputs-custom-engine.lock.yml b/.github/workflows/test-safe-outputs-custom-engine.lock.yml index 9557f7d5e3c..e74a7882046 100644 --- a/.github/workflows/test-safe-outputs-custom-engine.lock.yml +++ b/.github/workflows/test-safe-outputs-custom-engine.lock.yml @@ -680,11 +680,10 @@ jobs: const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -1095,6 +1094,10 @@ jobs: if (errors.length > 0) { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } diff --git a/pkg/workflow/js/collect_ndjson_output.cjs b/pkg/workflow/js/collect_ndjson_output.cjs index da426046f1e..e8593d89144 100644 --- a/pkg/workflow/js/collect_ndjson_output.cjs +++ b/pkg/workflow/js/collect_ndjson_output.cjs @@ -277,11 +277,10 @@ async function main() { const repairedJson = repairJson(jsonStr); return JSON.parse(repairedJson); } catch (repairError) { - // If repair also fails, print error to console and return undefined - console.log( - `JSON parsing failed. Original: ${originalError.message}. After repair: ${repairError.message}` + // If repair also fails, throw the error + throw new Error( + `JSON parsing failed. Original: ${originalError.message}. After attempted repair: ${repairError.message}` ); - return undefined; } } } @@ -716,6 +715,11 @@ async function main() { core.warning("Validation errors found:"); errors.forEach(error => core.warning(` - ${error}`)); + if (parsedItems.length === 0) { + core.setFailed(errors.map(e => ` - ${e}`).join("\n")); + return; + } + // For now, we'll continue with valid items but log the errors // In the future, we might want to fail the workflow for invalid items } From 43acba2d88faa93a7fe0c51ac4c97c446427f774 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 9 Sep 2025 23:56:00 +0100 Subject: [PATCH 3/3] fix failing tests --- package-lock.json | 85 +++++++++++--- package.json | 4 +- .../js/collect_ndjson_output.test.cjs | 106 +++++++++--------- 3 files changed, 127 insertions(+), 68 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f6152140e4..225f06053fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,9 +4,6 @@ "requires": true, "packages": { "": { - "dependencies": { - "vite": "^7.1.4" - }, "devDependencies": { "@actions/core": "^1.11.1", "@actions/exec": "^1.1.1", @@ -18,6 +15,7 @@ "@vitest/ui": "^3.2.4", "prettier": "^3.4.2", "typescript": "^5.9.2", + "vite": "^7.1.5", "vitest": "^3.2.4" } }, @@ -192,6 +190,7 @@ "cpu": [ "ppc64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -208,6 +207,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -224,6 +224,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -240,6 +241,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -256,6 +258,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -272,6 +275,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -288,6 +292,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -304,6 +309,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -320,6 +326,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -336,6 +343,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -352,6 +360,7 @@ "cpu": [ "ia32" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -368,6 +377,7 @@ "cpu": [ "loong64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -384,6 +394,7 @@ "cpu": [ "mips64el" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -400,6 +411,7 @@ "cpu": [ "ppc64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -416,6 +428,7 @@ "cpu": [ "riscv64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -432,6 +445,7 @@ "cpu": [ "s390x" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -448,6 +462,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -464,6 +479,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -480,6 +496,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -496,6 +513,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -512,6 +530,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -528,6 +547,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -544,6 +564,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -560,6 +581,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -576,6 +598,7 @@ "cpu": [ "ia32" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -592,6 +615,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -875,6 +899,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -888,6 +913,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -901,6 +927,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -914,6 +941,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -927,6 +955,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -940,6 +969,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -953,6 +983,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -966,6 +997,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -979,6 +1011,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -992,6 +1025,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1005,6 +1039,7 @@ "cpu": [ "loong64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1018,6 +1053,7 @@ "cpu": [ "ppc64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1031,6 +1067,7 @@ "cpu": [ "riscv64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1044,6 +1081,7 @@ "cpu": [ "riscv64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1057,6 +1095,7 @@ "cpu": [ "s390x" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1070,6 +1109,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1083,6 +1123,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1096,6 +1137,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1109,6 +1151,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1122,6 +1165,7 @@ "cpu": [ "ia32" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1135,6 +1179,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1162,13 +1207,14 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, "license": "MIT" }, "node_modules/@types/node": { "version": "24.3.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.1.tgz", "integrity": "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "undici-types": "~7.10.0" @@ -1529,6 +1575,7 @@ "version": "0.25.9", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz", "integrity": "sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==", + "dev": true, "hasInstallScript": true, "license": "MIT", "bin": { @@ -1590,6 +1637,7 @@ "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, "license": "MIT", "engines": { "node": ">=12.0.0" @@ -1638,6 +1686,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, @@ -1879,6 +1928,7 @@ "version": "3.3.11", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, "funding": [ { "type": "github", @@ -1958,12 +2008,14 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, "license": "ISC" }, "node_modules/picomatch": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -1976,6 +2028,7 @@ "version": "8.5.6", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, "funding": [ { "type": "opencollective", @@ -2020,6 +2073,7 @@ "version": "4.50.0", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.0.tgz", "integrity": "sha512-/Zl4D8zPifNmyGzJS+3kVoyXeDeT/GrsJM94sACNg9RtUE0hrHa1bNPtRSrfHTMH5HjRzce6K7rlTh3Khiw+pw==", + "dev": true, "license": "MIT", "dependencies": { "@types/estree": "1.0.8" @@ -2131,6 +2185,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -2310,13 +2365,14 @@ "license": "MIT" }, "node_modules/tinyglobby": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", - "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, "license": "MIT", "dependencies": { - "fdir": "^6.4.4", - "picomatch": "^4.0.2" + "fdir": "^6.5.0", + "picomatch": "^4.0.3" }, "engines": { "node": ">=12.0.0" @@ -2406,7 +2462,7 @@ "version": "7.10.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/universal-user-agent": { @@ -2417,9 +2473,10 @@ "license": "ISC" }, "node_modules/vite": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.4.tgz", - "integrity": "sha512-X5QFK4SGynAeeIt+A7ZWnApdUyHYm+pzv/8/A57LqSGcI88U6R6ipOs3uCesdc6yl7nl+zNO0t8LmqAdXcQihw==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.5.tgz", + "integrity": "sha512-4cKBO9wR75r0BeIWWWId9XK9Lj6La5X846Zw9dFfzMRw38IlTk2iCcUt6hsyiDRcPidc55ZParFYDXi0nXOeLQ==", + "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.25.0", @@ -2427,7 +2484,7 @@ "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", - "tinyglobby": "^0.2.14" + "tinyglobby": "^0.2.15" }, "bin": { "vite": "bin/vite.js" diff --git a/package.json b/package.json index e2043806448..da08aea34ca 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "@vitest/ui": "^3.2.4", "prettier": "^3.4.2", "typescript": "^5.9.2", + "vite": "^7.1.5", "vitest": "^3.2.4" }, "scripts": { @@ -20,8 +21,5 @@ "test:js-coverage": "vitest run --coverage", "format:cjs": "prettier --write 'pkg/workflow/js/**/*.cjs'", "lint:cjs": "prettier --check 'pkg/workflow/js/**/*.cjs'" - }, - "dependencies": { - "vite": "^7.1.4" } } diff --git a/pkg/workflow/js/collect_ndjson_output.test.cjs b/pkg/workflow/js/collect_ndjson_output.test.cjs index 89f40cec546..50aa970599c 100644 --- a/pkg/workflow/js/collect_ndjson_output.test.cjs +++ b/pkg/workflow/js/collect_ndjson_output.test.cjs @@ -19,6 +19,7 @@ describe("collect_ndjson_output.cjs", () => { // Mock core actions methods mockCore = { setOutput: vi.fn(), + setFailed: vi.fn(), warning: vi.fn(), error: vi.fn(), exportVariable: vi.fn(), @@ -148,15 +149,16 @@ describe("collect_ndjson_output.cjs", () => { await eval(`(async () => { ${collectScript} })()`); + // Since there are errors and no valid items, setFailed should be called + expect(mockCore.setFailed).toHaveBeenCalledTimes(1); + const failedMessage = mockCore.setFailed.mock.calls[0][0]; + expect(failedMessage).toContain("requires a 'body' string field"); + expect(failedMessage).toContain("requires a 'title' string field"); + + // setOutput should not be called because of early return const setOutputCalls = mockCore.setOutput.mock.calls; const outputCall = setOutputCalls.find(call => call[0] === "output"); - expect(outputCall).toBeDefined(); - - const parsedOutput = JSON.parse(outputCall[1]); - expect(parsedOutput.items).toHaveLength(0); - expect(parsedOutput.errors).toHaveLength(2); - expect(parsedOutput.errors[0]).toContain("requires a 'body' string field"); - expect(parsedOutput.errors[1]).toContain("requires a 'title' string field"); + expect(outputCall).toBeUndefined(); }); it("should validate required fields for add-issue-label type", async () => { @@ -644,14 +646,15 @@ Line 3"} await eval(`(async () => { ${collectScript} })()`); + // Since there are errors and no valid items, setFailed should be called + expect(mockCore.setFailed).toHaveBeenCalledTimes(1); + const failedMessage = mockCore.setFailed.mock.calls[0][0]; + expect(failedMessage).toContain("JSON parsing failed"); + + // setOutput should not be called because of early return const setOutputCalls = mockCore.setOutput.mock.calls; const outputCall = setOutputCalls.find(call => call[0] === "output"); - expect(outputCall).toBeDefined(); - - const parsedOutput = JSON.parse(outputCall[1]); - expect(parsedOutput.items).toHaveLength(0); - expect(parsedOutput.errors).toHaveLength(1); - expect(parsedOutput.errors[0]).toContain("JSON parsing failed"); + expect(outputCall).toBeUndefined(); }); it("should preserve valid JSON without modification", async () => { @@ -730,21 +733,21 @@ Line 3"} await eval(`(async () => { ${collectScript} })()`); + // Check if repair succeeded by looking at mock calls const setOutputCalls = mockCore.setOutput.mock.calls; const outputCall = setOutputCalls.find(call => call[0] === "output"); - expect(outputCall).toBeDefined(); - - const parsedOutput = JSON.parse(outputCall[1]); - // This case may be too complex for the current repair logic - if (parsedOutput.items.length === 1) { + + if (outputCall) { + // Repair succeeded + const parsedOutput = JSON.parse(outputCall[1]); expect(parsedOutput.items[0].type).toBe("add-issue-label"); expect(parsedOutput.items[0].labels).toEqual(["bug", "feature"]); expect(parsedOutput.errors).toHaveLength(0); } else { - // If repair fails, it should report an error - expect(parsedOutput.items).toHaveLength(0); - expect(parsedOutput.errors).toHaveLength(1); - expect(parsedOutput.errors[0]).toContain("JSON parsing failed"); + // Repair failed, should have called setFailed + expect(mockCore.setFailed).toHaveBeenCalledTimes(1); + const failedMessage = mockCore.setFailed.mock.calls[0][0]; + expect(failedMessage).toContain("JSON parsing failed"); } }); @@ -823,15 +826,15 @@ Line 3"} await eval(`(async () => { ${collectScript} })()`); + // Since this JSON is too malformed to repair and results in no valid items, setFailed should be called + expect(mockCore.setFailed).toHaveBeenCalledTimes(1); + const failedMessage = mockCore.setFailed.mock.calls[0][0]; + expect(failedMessage).toContain("JSON parsing failed"); + + // setOutput should not be called because of early return const setOutputCalls = mockCore.setOutput.mock.calls; const outputCall = setOutputCalls.find(call => call[0] === "output"); - expect(outputCall).toBeDefined(); - - const parsedOutput = JSON.parse(outputCall[1]); - // This JSON is too malformed to repair reliably, so we expect it to fail - expect(parsedOutput.items).toHaveLength(0); - expect(parsedOutput.errors).toHaveLength(1); - expect(parsedOutput.errors[0]).toContain("JSON parsing failed"); + expect(outputCall).toBeUndefined(); }); it("should repair very long strings with multiple issues", async () => { @@ -942,14 +945,15 @@ Line 3"} await eval(`(async () => { ${collectScript} })()`); + // Since this JSON is fundamentally broken and results in no valid items, setFailed should be called + expect(mockCore.setFailed).toHaveBeenCalledTimes(1); + const failedMessage = mockCore.setFailed.mock.calls[0][0]; + expect(failedMessage).toContain("JSON parsing failed"); + + // setOutput should not be called because of early return const setOutputCalls = mockCore.setOutput.mock.calls; const outputCall = setOutputCalls.find(call => call[0] === "output"); - expect(outputCall).toBeDefined(); - - const parsedOutput = JSON.parse(outputCall[1]); - expect(parsedOutput.items).toHaveLength(0); - expect(parsedOutput.errors).toHaveLength(1); - expect(parsedOutput.errors[0]).toContain("JSON parsing failed"); + expect(outputCall).toBeUndefined(); }); it("should handle repair of JSON with missing property separators", async () => { @@ -962,15 +966,15 @@ Line 3"} await eval(`(async () => { ${collectScript} })()`); + // Since this JSON likely fails to repair and results in no valid items, setFailed should be called + expect(mockCore.setFailed).toHaveBeenCalledTimes(1); + const failedMessage = mockCore.setFailed.mock.calls[0][0]; + expect(failedMessage).toContain("JSON parsing failed"); + + // setOutput should not be called because of early return const setOutputCalls = mockCore.setOutput.mock.calls; const outputCall = setOutputCalls.find(call => call[0] === "output"); - expect(outputCall).toBeDefined(); - - const parsedOutput = JSON.parse(outputCall[1]); - // This should likely fail to repair since the repair function doesn't handle missing colons - expect(parsedOutput.items).toHaveLength(0); - expect(parsedOutput.errors).toHaveLength(1); - expect(parsedOutput.errors[0]).toContain("JSON parsing failed"); + expect(outputCall).toBeUndefined(); }); it("should repair arrays with mixed bracket types in complex structures", async () => { @@ -1008,21 +1012,21 @@ Line 3"} await eval(`(async () => { ${collectScript} })()`); + // Check if repair succeeded by looking at mock calls const setOutputCalls = mockCore.setOutput.mock.calls; const outputCall = setOutputCalls.find(call => call[0] === "output"); - expect(outputCall).toBeDefined(); - - const parsedOutput = JSON.parse(outputCall[1]); - // Multiple consecutive commas might be too complex for the repair function - if (parsedOutput.items.length === 1) { + + if (outputCall) { + // Repair succeeded + const parsedOutput = JSON.parse(outputCall[1]); expect(parsedOutput.items[0].type).toBe("create-issue"); expect(parsedOutput.items[0].title).toBe("Test"); expect(parsedOutput.errors).toHaveLength(0); } else { - // If repair fails, it should report an error - expect(parsedOutput.items).toHaveLength(0); - expect(parsedOutput.errors).toHaveLength(1); - expect(parsedOutput.errors[0]).toContain("JSON parsing failed"); + // Repair failed, should have called setFailed + expect(mockCore.setFailed).toHaveBeenCalledTimes(1); + const failedMessage = mockCore.setFailed.mock.calls[0][0]; + expect(failedMessage).toContain("JSON parsing failed"); } });