Skip to content

Commit e78429e

Browse files
🩹 [Patch]: Align WorkingDirectory usage in workflows and update path resolution in main script
1 parent ae149ea commit e78429e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎.github/workflows/Action-Test.yml‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
uses: ./
3232
id: action-test
3333
with:
34-
WorkingDirectory: tests/srcTestRepo
3534
Path: src
3635
Settings: SourceCode
36+
WorkingDirectory: tests/srcTestRepo
3737

3838
- name: Status
3939
shell: pwsh
@@ -55,10 +55,10 @@ jobs:
5555
uses: ./
5656
id: action-test
5757
with:
58-
WorkingDirectory: tests/srcTestRepo
5958
Path: src
6059
Settings: Custom
6160
SettingsFilePath: tests/Custom.Settings.psd1
61+
WorkingDirectory: tests/srcTestRepo
6262

6363
- name: Status
6464
shell: pwsh
@@ -81,9 +81,9 @@ jobs:
8181
continue-on-error: true
8282
id: action-test
8383
with:
84-
WorkingDirectory: tests/srcWithManifestTestRepo
8584
Path: src
8685
Settings: SourceCode
86+
WorkingDirectory: tests/srcWithManifestTestRepo
8787

8888
- name: Status
8989
shell: pwsh
@@ -105,9 +105,9 @@ jobs:
105105
uses: ./
106106
id: action-test
107107
with:
108-
WorkingDirectory: tests/outputTestRepo
109108
Path: outputs/modules/PSModuleTest
110109
Settings: Module
110+
WorkingDirectory: tests/outputTestRepo
111111

112112
- name: Status
113113
shell: pwsh
@@ -229,4 +229,3 @@ jobs:
229229
Write-GitHubError 'One or more jobs failed'
230230
exit 1
231231
}
232-

‎scripts/main.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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+
$codePath = Resolve-Path -Path "./$env:PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_Path" | Select-Object -ExpandProperty Path
55
$settingsFilePath = switch -Regex ($settings) {
66
'Module|SourceCode' {
77
"$testPath/$settings.Settings.psd1"

0 commit comments

Comments
 (0)