From 77b839b4b264f8daab8b950f46fbfedbf3cd25c6 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 20 Jul 2023 11:45:40 -0600 Subject: [PATCH] feat: update error handling for yaml inputs --- src/utils.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 505b49e15d3..fc9aea0de6d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -893,17 +893,17 @@ const getYamlFilePatternsFromContents = async ({ if (doc.errors.length > 0) { if (filePath) { - core.warning(`YAML errors in ${filePath}: ${doc.errors}`) + throw new Error(`YAML errors in ${filePath}: ${doc.errors}`) } else { - core.warning(`YAML errors: ${doc.errors}`) + throw new Error(`YAML errors: ${doc.errors}`) } } if (doc.warnings.length > 0) { if (filePath) { - core.warning(`YAML warnings in ${filePath}: ${doc.warnings}`) + throw new Error(`YAML warnings in ${filePath}: ${doc.warnings}`) } else { - core.warning(`YAML warnings: ${doc.warnings}`) + throw new Error(`YAML warnings: ${doc.warnings}`) } } @@ -1164,9 +1164,7 @@ export const hasLocalGitDirectory = async ({ }: { workingDirectory: string }): Promise => { - const insideWorkTree = await isInsideWorkTree({ + return await isInsideWorkTree({ cwd: workingDirectory }) - - return insideWorkTree }