Skip to content

Commit

Permalink
feat: update error handling for yaml inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Jul 20, 2023
1 parent bc262c2 commit 77b839b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
}

Expand Down Expand Up @@ -1164,9 +1164,7 @@ export const hasLocalGitDirectory = async ({
}: {
workingDirectory: string
}): Promise<boolean> => {
const insideWorkTree = await isInsideWorkTree({
return await isInsideWorkTree({
cwd: workingDirectory
})

return insideWorkTree
}

0 comments on commit 77b839b

Please sign in to comment.