diff --git a/dist/index.js b/dist/index.js index 1dc3857..176704e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -30382,27 +30382,28 @@ const litAnalyzer = async (command) => { } catch (error) { (0, core_1.setFailed)(`Failed ${command.label}: ${error}`); - } - const lines = outputStr.split("\n"); - const table = lines - .map((line) => { - const match = line.match(/^\s*(\S+)\s+(\d+):\s+(.*)$/); - if (match) { - const [_, file, line, message] = match; - return `${file}${line}${message}`; - } - return ""; - }) - .join(""); - const problemCount = lines.filter((line) => line.match(/^\s*(\S+)\s+(\d+):\s+(.*)$/)).length; - if (problemCount > 0) { response.error = true; + } + if (response.error == true) { + const lines = outputStr.split("\n"); + const table = lines + .map((line) => { + const match = line.match(/^\s*(\S+)\s+(\d+):\s+(.*)$/); + if (match) { + const [_, file, line, message] = match; + return `${file}${line}${message}`; + } + return ""; + }) + .join(""); + const problemCount = lines.filter((line) => line.match(/^\s*(\S+)\s+(\d+):\s+(.*)$/)).length; response.output = `${main_1.failedEmoji} - ${command.label}: ${problemCount} problem${problemCount !== 1 ? "s" : ""} found\n
See Details${table}
FileLineMessage
`; + return response; } else { response.output = `${main_1.passedEmoji} - ${command.label}\n`; + return response; } - return response; }; exports.litAnalyzer = litAnalyzer; const analyze = async () => { diff --git a/src/scripts/analyze.ts b/src/scripts/analyze.ts index 6d85f78..145865a 100644 --- a/src/scripts/analyze.ts +++ b/src/scripts/analyze.ts @@ -65,31 +65,33 @@ export const litAnalyzer = async (command: Command): Promise => { }); } catch (error) { setFailed(`Failed ${command.label}: ${error}`); + response.error = true; } - const lines = outputStr.split("\n"); - const table = lines - .map((line) => { - const match = line.match(/^\s*(\S+)\s+(\d+):\s+(.*)$/); - if (match) { - const [_, file, line, message] = match; - return `${file}${line}${message}`; - } - return ""; - }) - .join(""); + if (response.error == true) { + const lines = outputStr.split("\n"); + const table = lines + .map((line) => { + const match = line.match(/^\s*(\S+)\s+(\d+):\s+(.*)$/); + if (match) { + const [_, file, line, message] = match; + return `${file}${line}${message}`; + } + return ""; + }) + .join(""); - const problemCount = lines.filter((line) => - line.match(/^\s*(\S+)\s+(\d+):\s+(.*)$/), - ).length; + const problemCount = lines.filter((line) => + line.match(/^\s*(\S+)\s+(\d+):\s+(.*)$/), + ).length; - if (problemCount > 0) { - response.error = true; response.output = `${failedEmoji} - ${command.label}: ${problemCount} problem${problemCount !== 1 ? "s" : ""} found\n
See Details${table}
FileLineMessage
`; + + return response; } else { response.output = `${passedEmoji} - ${command.label}\n`; + return response; } - return response; }; export const analyze = async (): Promise => {