Skip to content

Commit

Permalink
🪲 [Fix]: Fix conditional logic for test result handling (#92)
Browse files Browse the repository at this point in the history
## 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

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [ ] 📖 [Docs]
- [x] 🪲 [Fix]
- [ ] 🩹 [Patch]
- [ ] ⚠️ [Security fix]
- [ ] 🚀 [Feature]
- [ ] 🌟 [Breaking change]

## Checklist

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
  • Loading branch information
MariusStorhaug authored Jan 30, 2025
1 parent e96fb15 commit 49dd4d7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49dd4d7

Please sign in to comment.