From dfe9967f2f231f5cee76530dcaa8158261957420 Mon Sep 17 00:00:00 2001 From: Ben Coleman Date: Wed, 2 Sep 2026 17:18:25 +0100 Subject: [PATCH] Fail dispatch for invalid JSON inputs --- dist/index.js | 4 +++- src/main.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index e8e286e..5976c83 100644 --- a/dist/index.js +++ b/dist/index.js @@ -23601,7 +23601,9 @@ async function run() { try { inputs = JSON.parse(inputsJson); } catch (e) { - error(`Failed to parse 'inputs' JSON string: ${e instanceof Error ? e.message : String(e)}`); + throw new Error(`Failed to parse 'inputs' JSON string: ${e instanceof Error ? e.message : String(e)}`, { + cause: e + }); } } const octokit = getOctokit(token); diff --git a/src/main.ts b/src/main.ts index 36f4f46..6bf1095 100644 --- a/src/main.ts +++ b/src/main.ts @@ -40,7 +40,9 @@ async function run(): Promise { try { inputs = JSON.parse(inputsJson) } catch (e) { - core.error(`Failed to parse 'inputs' JSON string: ${e instanceof Error ? e.message : String(e)}`) + throw new Error(`Failed to parse 'inputs' JSON string: ${e instanceof Error ? e.message : String(e)}`, { + cause: e, + }) } }