Skip to content

Commit

Permalink
feat: Export-PipeScript Build Summary and Output Improvement ( Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Feb 16, 2024
1 parent 45b9b02 commit b150fa5
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Commands/PipeScript/Export-PipeScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,29 @@ function Export-Pipescript {

if ($env:GITHUB_WORKSPACE -or ($host.Name -eq 'Default Host')) {
$FileBuildEnded = [DateTime]::now

"$($buildFile.Source)", "$('=' * $buildFile.Source.Length)", "Output:" -join [Environment]::newLine | Out-Host
if ($buildOutput -is [Management.Automation.ErrorRecord]) {
if ($buildOutput -is [Management.Automation.ErrorRecord] -or $buildOutput -is [Exception]) {
$buildOutput | Out-Host
if ($env:GITHUB_STEP_SUMMARY) {
@(
"* ❌ ``$($buildFile.Source | Split-Path -Leaf)`` !!!:"
'~~~'
$($buildOutput | Out-String)
'~~~'
) -join [Environment]::newLine| Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY
}
} else {
$buildOutput.FullName | Out-Host
if ($env:GITHUB_STEP_SUMMARY) {
@(
"* ✅ ``$($buildFile.Source | Split-Path -Leaf)``$(if ($buildOutput -is [IO.FileInfo]) { $buildOutput.Name })"
" * $(@(if ($buildOutput -is [object[]]) {
foreach ($buildOutObject in $buildOutput) {
$buildOutput.Name
}
}) -join ([Environment]::newLine + ' * '))"
) -join [Environment]::newLine | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY
}
}
$totalProcessTime = 0
if ($env:ACTIONS_RUNNER_DEBUG) {
Expand Down

0 comments on commit b150fa5

Please sign in to comment.