Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🩹 [Patch]: Optimize output retrieval and improve warning messages
  • Loading branch information
MariusStorhaug committed Jan 5, 2025
commit b47a03cef379edfaf3b1cccf9d272685c9da247d
9 changes: 7 additions & 2 deletions scripts/outputs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ param()
$DebugPreference = 'SilentlyContinue'
$VerbosePreference = 'SilentlyContinue'

$result = (Get-GitHubOutput).result
if (-not $result) {
return
}

Write-Host '┏━━━━━┫ GitHub-Script ┣━━━━━┓'

LogGroup ' - Outputs' {
if ([string]::IsNullOrEmpty($env:GITHUB_ACTION)) {
Write-Warning 'Outputs cannot be accessed as the step has no ID.'
Write-GitHubWarning 'Outputs cannot be accessed as the step has no ID.'
}

if (-not (Test-Path -Path $env:GITHUB_OUTPUT)) {
Write-Warning "File not found: $env:GITHUB_OUTPUT"
}

(Get-GitHubOutput).result | Format-List
$result | Format-List
Write-Host "Access outputs using `${{ fromJson(steps.$env:GITHUB_ACTION.outputs.result).<output-name> }}"
}

Expand Down