Skip to content

Commit 62cfad3

Browse files
Refactor main.ps1 to use Resolve-Path for module source and output folder paths for improved reliability
1 parent ebc8549 commit 62cfad3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/main.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ LogGroup 'Loading inputs' {
1919
$moduleName = ($env:GITHUB_ACTION_INPUT_Name | IsNullOrEmpty) ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name
2020
Write-Host "Module name: [$moduleName]"
2121

22-
$moduleSourceFolderPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath $env:GITHUB_ACTION_INPUT_Path/src
22+
$moduleSourceFolderPath = Resolve-Path -Path "$env:GITHUB_ACTION_INPUT_Path/src" | Select-Object -ExpandProperty Path
2323
if (-not (Test-Path -Path $moduleSourceFolderPath)) {
2424
throw "Module path [$moduleSourceFolderPath] does not exist."
2525
}
2626

27-
$modulesOutputFolderPath = Join-Path $env:GITHUB_ACTION_INPUT_Path -ChildPath 'outputs/module'
27+
$modulesOutputFolderPath = Resolve-Path -Path "$env:GITHUB_ACTION_INPUT_Path/outputs/module" | Select-Object -ExpandProperty Path
2828
Write-Host "Module output path: [$modulesOutputFolderPath]"
29-
$docsOutputFolderPath = Join-Path $env:GITHUB_ACTION_INPUT_Path -ChildPath 'outputs/docs'
29+
$docsOutputFolderPath = Resolve-Path -Path "$env:GITHUB_ACTION_INPUT_Path/outputs/docs" | Select-Object -ExpandProperty Path
3030
Write-Host "Docs output path: [$docsOutputFolderPath]"
3131
}
3232

0 commit comments

Comments
 (0)