diff --git a/dist/index.js b/dist/index.js index c6d7121..607119c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -45939,7 +45939,7 @@ async function format(bufPath, inputs) { args.push("--exclude-path", path); } const result = await run(bufPath, args); - if (result.status == Status.Failed) { + if (result.status == Status.Failed && result.stdout.startsWith("diff")) { // If the format step fails, parse the diff and write github annotations. const diff = parse_diff(result.stdout); result.stdout = ""; // Clear the stdout. @@ -45947,6 +45947,7 @@ async function format(bufPath, inputs) { for (const file of diff) { result.stdout += `::error file=${file.to}::Format failed -${file.deletions} +${file.additions} changes.\n`; } + console.log(result.stdout); } return result; } diff --git a/src/main.ts b/src/main.ts index 0f71772..4d81ede 100644 --- a/src/main.ts +++ b/src/main.ts @@ -229,7 +229,7 @@ async function format(bufPath: string, inputs: Inputs): Promise { args.push("--exclude-path", path); } const result = await run(bufPath, args); - if (result.status == Status.Failed) { + if (result.status == Status.Failed && result.stdout.startsWith("diff")) { // If the format step fails, parse the diff and write github annotations. const diff = parseDiff(result.stdout); result.stdout = ""; // Clear the stdout. @@ -237,6 +237,7 @@ async function format(bufPath: string, inputs: Inputs): Promise { for (const file of diff) { result.stdout += `::error file=${file.to}::Format failed -${file.deletions} +${file.additions} changes.\n`; } + console.log(result.stdout); } return result; }