mirror of
https://github.com/tj-actions/changed-files
synced 2025-01-18 13:57:39 +00:00
feat: update error handling for yaml inputs (#1395)
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
parent
bc262c2f61
commit
de0eba3279
3 changed files with 5 additions and 7 deletions
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
12
src/utils.ts
12
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<boolean> => {
|
||||
const insideWorkTree = await isInsideWorkTree({
|
||||
return await isInsideWorkTree({
|
||||
cwd: workingDirectory
|
||||
})
|
||||
|
||||
return insideWorkTree
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue