Skip to content

Commit

Permalink
🩹 [Patch]: Simplify JSON conversion logic in ConvertTo-GitHubOutput.p…
Browse files Browse the repository at this point in the history
…s1 to handle non-string values
  • Loading branch information
MariusStorhaug committed Feb 24, 2025
1 parent c2474ce commit b080a61
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/functions/private/Commands/ConvertTo-GitHubOutput.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@
Write-Debug ($InputObject | Out-String)

# Convert hashtable or PSCustomObject to compressed JSON
if ($value -is [hashtable] -or $value -is [PSCustomObject]) {
Write-Debug 'Converting property value to JSON'
if (-not ($value -is [string])) {
# This condition now catches objects, hashtables, and arrays.
$value = $value | ConvertTo-Json -Compress -Depth 100
Write-Debug 'Property value:'
Write-Debug $value
}

$guid = [Guid]::NewGuid().ToString()
Expand Down

0 comments on commit b080a61

Please sign in to comment.