From d62784f13e3313efb6107e772ed973c9431197d2 Mon Sep 17 00:00:00 2001 From: thsaravana Date: Tue, 25 Jul 2023 00:24:10 +0200 Subject: [PATCH] Fixing the path type --- src/action.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/action.js b/src/action.js index bd8a8cf..588d61c 100644 --- a/src/action.js +++ b/src/action.js @@ -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) }) )