Skip to content

Commit b20fe03

Browse files
🩹 [CI]: Update Test-ModuleLocal workflow to import module path dynamically for improved flexibility
1 parent 3b2d649 commit b20fe03

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎.github/workflows/Test-ModuleLocal.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,14 @@ jobs:
108108
- name: Install-PSModuleHelpers
109109
uses: PSModule/Install-PSModuleHelpers@v1
110110

111-
- name: Get-ModuleName
111+
- name: Import-Module
112+
id: import-module
112113
shell: pwsh
113114
working-directory: ${{ inputs.WorkingDirectory }}
114115
run: |
115116
$name = Get-ChildItem "outputs/module" | Select-Object -ExpandProperty Name
116-
Install-PSModule -Path "outputs/module/$name"
117+
$path = Install-PSModule -Path "outputs/module/$name" -PassThru
118+
"path=$path" >> $GITHUB_OUTPUT
117119
118120
- name: Test-ModuleLocal
119121
uses: PSModule/Invoke-Pester@v3
@@ -129,5 +131,5 @@ jobs:
129131
Output_Verbosity: Detailed
130132
CodeCoverage_OutputFormat: JaCoCo
131133
Path: ${{ inputs.TestFolderPath }}
132-
Run_Path: outputs/module
134+
Run_Path: ${{ steps.import-module.outputs.path }}
133135
WorkingDirectory: ${{ inputs.WorkingDirectory }}

0 commit comments

Comments
 (0)