diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index e49e735..28d7292 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -225,6 +225,12 @@ jobs: Get-Content $env:GITHUB_OUTPUT -Raw | Set-GitHubStepSummary } + LogGroup "ErrorView should be 'NormalView' - [$ErrorView]" { + if ($ErrorView -ne 'NormalView') { + throw 'ErrorView is not NormalView' + } + } + - name: Run-test shell: pwsh env: diff --git a/action.yml b/action.yml index 054fb3d..431813c 100644 --- a/action.yml +++ b/action.yml @@ -91,6 +91,7 @@ runs: PSMODULE_GITHUB_SCRIPT_INPUT_PreserveCredentials: ${{ inputs.PreserveCredentials }} run: | # ${{ inputs.Name }} + $ErrorView = $env:PSMODULE_GITHUB_SCRIPT_INPUT_ErrorView try { ${{ github.action_path }}/scripts/init.ps1 ${{ github.action_path }}/scripts/info.ps1 diff --git a/scripts/init.ps1 b/scripts/init.ps1 index 486802c..2cd7566 100644 --- a/scripts/init.ps1 +++ b/scripts/init.ps1 @@ -4,23 +4,6 @@ param() begin { $scriptName = $MyInvocation.MyCommand.Name Write-Debug "[$scriptName] - Start" - $PSStyle.OutputRendering = 'Ansi' - - # Configure ErrorView based on input parameter - if (-not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_ErrorView)) { - $validViews = @('NormalView', 'CategoryView', 'ConciseView', 'DetailedView') - $errorViewSetting = $env:PSMODULE_GITHUB_SCRIPT_INPUT_ErrorView - - # Simply find the first validView that matches the input using wildcards - $matchedView = $validViews | Where-Object { $_ -like "*$errorViewSetting*" } | Select-Object -First 1 - - if ($matchedView) { - Write-Debug "[$scriptName] - Input [$errorViewSetting] matched with [$matchedView]" - $ErrorView = $matchedView - } else { - Write-Warning "[$scriptName] - Invalid ErrorView value: [$errorViewSetting]. Using default." - } - } } process {