From 49dd4d7279ac3046cf0b5325cdf05b70725a3fc5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 30 Jan 2025 22:50:54 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=B2=20[Fix]:=20Fix=20conditional=20log?= =?UTF-8?q?ic=20for=20test=20result=20handling=20(#92)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This pull request includes a small change to the `scripts/main.ps1` file. The change modifies the conditional logic to use an `elseif` statement instead of a separate `if` statement, ensuring that the script correctly handles the cases where tests have failed or all tests have passed. * [`scripts/main.ps1`](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011L55-R55): Changed the conditional logic from a separate `if` statement to an `elseif` statement to handle test results more accurately. ## Type of change - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- scripts/main.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index a8cf4df..39d0bfd 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -52,8 +52,7 @@ if (($failedTests -gt 0) -or ($testResults.Result -ne 'Passed')) { Write-GitHubError "❌ Some [$failedTests] tests failed." Set-GitHubOutput -Name 'passed' -Value $false $return = 1 -} -if ($failedTests -eq 0) { +} elseif ($failedTests -eq 0) { Write-GitHubNotice '✅ All tests passed.' Set-GitHubOutput -Name 'passed' -Value $true $return = 0