File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -284,8 +284,21 @@ jobs:
284284 return;
285285 }
286286 } else {
287- core.setFailed(`Output is not valid JSON and does not contain a JSON markdown block.\nRaw output: ${rawOutput}`);
288- return;
287+ // If no markdown block, try to find a raw JSON object in the output.
288+ // The CLI may include debug/log lines (e.g. telemetry init, YOLO mode)
289+ // before the actual JSON response.
290+ const jsonObjectMatch = rawOutput.match(/(\{[\s\S]*"labels_to_set"[\s\S]*\})/);
291+ if (jsonObjectMatch) {
292+ try {
293+ parsedLabels = JSON.parse(jsonObjectMatch[0]);
294+ } catch (extractError) {
295+ core.setFailed(`Found JSON-like content but failed to parse: ${extractError.message}\nRaw output: ${rawOutput}`);
296+ return;
297+ }
298+ } else {
299+ core.setFailed(`Output is not valid JSON and does not contain extractable JSON.\nRaw output: ${rawOutput}`);
300+ return;
301+ }
289302 }
290303 }
291304
You can’t perform that action at this time.
0 commit comments