Skip to content

Commit

Permalink
Fixing the path type
Browse files Browse the repository at this point in the history
  • Loading branch information
thsaravana committed Jul 24, 2023
1 parent 33ad78e commit d62784f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,14 @@ async function action() {

async function getJsonReports(xmlPaths, debugMode) {
if (debugMode) core.info(`xmlPaths: ${xmlPaths}`)
const paths = xmlPaths.map((xmlPath) => globSync(xmlPath))
const paths = xmlPaths.flatMap((xmlPath) => globSync(xmlPath))
if (debugMode) core.info(`paths: ${paths} : ${typeof paths}`)
return Promise.all(
paths
.filter((path) => path && path.fullPath().length !== 0)
.filter((path) => path && path.length !== 0)
.map(async (path) => {
if (debugMode) core.info(`path: ${path} : ${typeof path}`)
const reportXml = await fs.promises.readFile(
path.fullPath().trim(),
'utf-8'
)
const reportXml = await fs.promises.readFile(path.trim(), 'utf-8')
return await parser.parseStringPromise(reportXml)
})
)
Expand Down

0 comments on commit d62784f

Please sign in to comment.