diff --git a/src/actions.ts b/src/actions.ts index 69243918..31e7a4fe 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -11,7 +11,7 @@ export async function check(): Promise { onlyChangedFiles, }); - setOutput("has-changes", (!!result).toString()); + setOutput("has-changes", result.toString()); // fail fast will cause the workflow to stop on this job if (result && failFast) { @@ -27,5 +27,5 @@ export async function fix(): Promise { onlyChangedFiles, }); - setOutput("has-changes", (!!result).toString()); + setOutput("has-changes", result.toString()); } diff --git a/src/dotnet.ts b/src/dotnet.ts index 017c422c..49557600 100644 --- a/src/dotnet.ts +++ b/src/dotnet.ts @@ -26,7 +26,7 @@ function formatOnlyChangedFiles(onlyChangedFiles: boolean): boolean { return false; } -export async function format(options: FormatOptions): Promise { +export async function format(options: FormatOptions): Promise { const execOptions: ExecOptions = { ignoreReturnCode: true, }; @@ -45,7 +45,7 @@ export async function format(options: FormatOptions): Promise { // if there weren't any files to check then we need to bail if (!filesToCheck.length) { debug("No files found for formatting"); - return 0; + return false; } dotnetFormatOptions.push("--files", filesToCheck.join(",")); @@ -54,5 +54,5 @@ export async function format(options: FormatOptions): Promise { const dotnetPath: string = await which("dotnet", true); const dotnetResult = await exec(`"${dotnetPath}"`, dotnetFormatOptions, execOptions); - return dotnetResult; + return !!dotnetResult; }