|
1 | 1 | [CmdletBinding()] |
2 | 2 | param() |
3 | 3 |
|
4 | | - $DebugPreference = 'SilentlyContinue' |
5 | | - $VerbosePreference = 'SilentlyContinue' |
6 | | - $scriptName = $MyInvocation.MyCommand.Name |
7 | | - Write-Debug "[$scriptName] - Start" |
| 4 | +$DebugPreference = 'SilentlyContinue' |
| 5 | +$VerbosePreference = 'SilentlyContinue' |
| 6 | +$scriptName = $MyInvocation.MyCommand.Name |
| 7 | +Write-Debug "[$scriptName] - Start" |
8 | 8 |
|
9 | | - try { |
10 | | - Write-Debug "[$scriptName] - ShowOutput: $env:GITHUB_ACTION_INPUT_ShowOutput" |
11 | | - if ($env:GITHUB_ACTION_INPUT_ShowOutput -ne 'true') { |
12 | | - return |
13 | | - } |
| 9 | +try { |
| 10 | + Write-Debug "[$scriptName] - ShowOutput: $env:GITHUB_ACTION_INPUT_ShowOutput" |
| 11 | + if ($env:GITHUB_ACTION_INPUT_ShowOutput -ne 'true') { |
| 12 | + return |
| 13 | + } |
14 | 14 |
|
15 | | - $result = (Get-GitHubOutput).result |
16 | | - Write-Debug "[$scriptName] - Result: $(-not $result)" |
17 | | - if (-not $result) { |
18 | | - return |
| 15 | + $result = (Get-GitHubOutput).result |
| 16 | + Write-Debug "[$scriptName] - Result: $(-not $result)" |
| 17 | + if (-not $result) { |
| 18 | + return |
| 19 | + } |
| 20 | + $title = "┏━━━━━┫ $Name ┣━━━━━┓" |
| 21 | + Write-Output $title |
| 22 | + LogGroup ' - Outputs' { |
| 23 | + if ([string]::IsNullOrEmpty($env:GITHUB_ACTION)) { |
| 24 | + Write-GitHubWarning 'Outputs cannot be accessed as the step has no ID.' |
19 | 25 | } |
20 | | - $title = "┏━━━━━┫ $Name ┣━━━━━┓" |
21 | | - Write-Output $title |
22 | | - LogGroup ' - Outputs' { |
23 | | - if ([string]::IsNullOrEmpty($env:GITHUB_ACTION)) { |
24 | | - Write-GitHubWarning 'Outputs cannot be accessed as the step has no ID.' |
25 | | - } |
26 | 26 |
|
27 | | - if (-not (Test-Path -Path $env:GITHUB_OUTPUT)) { |
28 | | - Write-Warning "File not found: $env:GITHUB_OUTPUT" |
29 | | - } |
30 | | - |
31 | | - $result | Format-List |
32 | | - Write-Host "Access outputs using `${{ fromJson(steps.$env:GITHUB_ACTION.outputs.result).<output-name> }}" |
| 27 | + if (-not (Test-Path -Path $env:GITHUB_OUTPUT)) { |
| 28 | + Write-Warning "File not found: $env:GITHUB_OUTPUT" |
33 | 29 | } |
34 | | - $endingFence = '┗' + ('━' * ($title.Length - 2)) + '┛' |
35 | | - Write-Output $endingFence |
36 | | - } catch { |
37 | | - throw $_ |
| 30 | + |
| 31 | + $result | Format-List |
| 32 | + Write-Host "Access outputs using `${{ fromJson(steps.$env:GITHUB_ACTION.outputs.result).<output-name> }}" |
38 | 33 | } |
| 34 | + $endingFence = '┗' + ('━' * ($title.Length - 2)) + '┛' |
| 35 | + Write-Output $endingFence |
| 36 | +} catch { |
| 37 | + throw $_ |
| 38 | +} |
39 | 39 |
|
40 | | - Write-Debug "$scriptName - End" |
| 40 | +Write-Debug "$scriptName - End" |
0 commit comments