Skip to content

Commit 13e05c9

Browse files
🩹 [Patch]: Remove default value for Path input in action.yml and update path resolution logic in main.ps1
1 parent c3e5eb9 commit 13e05c9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎action.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ inputs:
99
Path:
1010
description: The path to the code to test.
1111
required: false
12-
default: '.'
1312
Settings:
1413
description: The type of tests to run. Can be either 'Module', 'SourceCode' or 'Custom'.
1514
required: false

‎scripts/main.ps1‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# If test type is module, the code we ought to test is in the path/name folder, otherwise it's in the path folder.
22
$settings = $env:PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_Settings
33
$testPath = Resolve-Path -Path "$PSScriptRoot/tests/PSScriptAnalyzer" | Select-Object -ExpandProperty Path
4-
$codePath = Resolve-Path -Path $env:PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_Path | Select-Object -ExpandProperty Path
4+
$path = [string]::IsNullOrEmpty($env:PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_Path) ? '.' : $env:PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_Path
5+
$codePath = Resolve-Path -Path $path | Select-Object -ExpandProperty Path | Select-Object -ExpandProperty Path
56
$settingsFilePath = switch -Regex ($settings) {
67
'Module|SourceCode' {
78
"$testPath/$settings.Settings.psd1"

0 commit comments

Comments
 (0)