Skip to content

Commit 081aac4

Browse files
Add log of outputs
1 parent d9a8681 commit 081aac4

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ runs:
6161
GITHUB_ACTION_INPUT_Prerelease: ${{ inputs.Prerelease }}
6262
run: |
6363
# GitHub-Script
64-
. "${{ github.action_path }}\scripts\main.ps1"
64+
. '${{ github.action_path }}\scripts\main.ps1'
6565
${{ inputs.Script }}
66+
. '${{ github.action_path }}\scripts\outputs.ps1'

scripts/outputs.ps1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[CmdletBinding()]
2+
param()
3+
4+
$DebugPreference = 'SilentlyContinue'
5+
$VerbosePreference = 'SilentlyContinue'
6+
7+
Write-Host '┏━━━━━┫ GitHub-Script ┣━━━━━┓'
8+
9+
LogGroup ' - Outputs' {
10+
if ([string]::IsNullOrEmpty($env:GITHUB_ACTION)) {
11+
Write-Warning 'Outputs cannot be accessed as the step has no ID.'
12+
}
13+
14+
if (-not (Test-Path -Path $env:GITHUB_OUTPUT)) {
15+
Write-Warning "File not found: $env:GITHUB_OUTPUT"
16+
}
17+
18+
Get-GitHubOutput | Format-List
19+
Write-Host "Access outputs using `${{ fromJson(steps.$env:GITHUB_ACTION.outputs.result).<output-name> }}"
20+
}
21+
22+
Write-Host '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━┛'

0 commit comments

Comments
 (0)