Skip to content

Commit 3685052

Browse files
Refactor output handling in main.ps1 to use GITHUB_OUTPUT for setting module and code paths
1 parent e7186d6 commit 3685052

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

scripts/main.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# If test type is module, the code we ought to test is in the WorkingDirectory/outputs/module/Name folder,
2-
# otherwise it's in the WorkingDirectory/src folder.
1+
[CmdletBinding()]
2+
param()
33

4+
$env:GITHUB_REPOSITORY_NAME = $env:GITHUB_REPOSITORY -replace '.+/'
45
$moduleName = if ([string]::IsNullOrEmpty($env:PSMODULE_TEST_PSMODULE_INPUT_Name)) {
56
$env:GITHUB_REPOSITORY_NAME
67
} else {
@@ -31,7 +32,7 @@ switch ($settings) {
3132
TestPath = $testPath
3233
} | Format-List | Out-String
3334

34-
Set-GitHubOutput -Name ModuleName -Value $moduleName
35-
Set-GitHubOutput -Name CodePath -Value $codePath
36-
Set-GitHubOutput -Name LocalTestPath -Value $localTestPath
37-
Set-GitHubOutput -Name TestPath -Value $testPath
35+
"ModuleName=$moduleName" >> $env:GITHUB_OUTPUT
36+
"CodePath=$codePath" >> $env:GITHUB_OUTPUT
37+
"LocalTestPath=$localTestPath" >> $env:GITHUB_OUTPUT
38+
"TestPath=$testPath" >> $env:GITHUB_OUTPUT

0 commit comments

Comments
 (0)