File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
scripts/tests/PSScriptAnalyzer Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,23 @@ BeforeDiscovery {
6565
6666Describe ' PSScriptAnalyzer' {
6767 BeforeAll {
68- $relativeSettingsFilePath = $SettingsFilePath.Replace ($PSScriptRoot , ' Action/' ).Trim(' \' ).Trim(' /' )
69- $relativeSettingsFilePath = $SettingsFilePath.Replace ($env: GITHUB_WORKSPACE , ' Workspace/' ).Trim(' \' ).Trim(' /' )
68+ $relativeSettingsFilePath = if ($SettingsFilePath.StartsWith ($PSScriptRoot )) {
69+ $SettingsFilePath.Replace ($PSScriptRoot , ' Action:' ).Trim(' \' ).Trim(' /' )
70+ } elseif ($SettingsFilePath.StartsWith ($env: GITHUB_WORKSPACE )) {
71+ $SettingsFilePath.Replace ($env: GITHUB_WORKSPACE , ' Workspace:' ).Trim(' \' ).Trim(' /' )
72+ } else {
73+ $SettingsFilePath
74+ }
75+ [pscustomobject ]@ {
76+ relativeSettingsFilePath = $relativeSettingsFilePath
77+ SettingsFilePath = $SettingsFilePath
78+ PSScriptRoot = $PSScriptRoot
79+ GITHUB_WORKSPACE = $env: GITHUB_WORKSPACE
80+ }
7081 LogGroup " Invoke-ScriptAnalyzer -Path [$Path ] -Settings [$relativeSettingsFilePath ]" {
7182 $testResults = Invoke-ScriptAnalyzer - Path $Path - Settings $SettingsFilePath - Recurse - Verbose
72- Write-Warning " Found [$ ( $testResults.Count ) ] issues"
7383 }
74- LogGroup " TestResults" {
84+ LogGroup " TestResults [ $ ( $testResults .Count ) ] " {
7585 $testResults
7686 }
7787 }
You can’t perform that action at this time.
0 commit comments