From fccb89847da56752cc71cb5fc43701e2a1260c10 Mon Sep 17 00:00:00 2001 From: Jesse Houwing Date: Tue, 14 Nov 2023 00:24:54 +0100 Subject: [PATCH] Only write suggested commands if they were logged --- main.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.ps1 b/main.ps1 index e2ff9a2..bd7f60f 100644 --- a/main.ps1 +++ b/main.ps1 @@ -211,8 +211,10 @@ if ($latest -and($latest.sha -ne $highestVersion.sha)) $suggestedCommands += "git push origin $($highestVersion.sha):latest --force`n" } - -Write-Output $suggestedCommands -write-output "### Suggested fix:`n```````n$suggestedCommands`n``````" >> $env:GITHUB_STEP_SUMMARY +if ($suggestedCommands -ne "") +{ + Write-Output $suggestedCommands + write-output "### Suggested fix:`n```````n$suggestedCommands`n``````" >> $env:GITHUB_STEP_SUMMARY +} exit $global:returnCode