Skip to content
Merged
Show file tree
Hide file tree
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
Next Next commit
Add log of outputs
  • Loading branch information
MariusStorhaug committed Jan 5, 2025
commit 081aac406b53f54e94e077f9cb49ce23432ed457
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ runs:
GITHUB_ACTION_INPUT_Prerelease: ${{ inputs.Prerelease }}
run: |
# GitHub-Script
. "${{ github.action_path }}\scripts\main.ps1"
. '${{ github.action_path }}\scripts\main.ps1'
${{ inputs.Script }}
. '${{ github.action_path }}\scripts\outputs.ps1'
22 changes: 22 additions & 0 deletions scripts/outputs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[CmdletBinding()]
param()

$DebugPreference = 'SilentlyContinue'
$VerbosePreference = 'SilentlyContinue'

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

LogGroup ' - Outputs' {
if ([string]::IsNullOrEmpty($env:GITHUB_ACTION)) {
Write-Warning '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 | Format-List
Write-Host "Access outputs using `${{ fromJson(steps.$env:GITHUB_ACTION.outputs.result).<output-name> }}"
}

Write-Host '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━┛'