File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ branding:
66 color : blue
77
88inputs :
9+ Name :
10+ description : Name of the module.
11+ required : false
912 SettingsPath :
1013 description : Path to the settings file (json, yaml/yml, or psd1)
1114 required : false
4144 uses : PSModule/GitHub-Script@8b9d2739d6896975c0e5448d2021ae2b94b6766a # v1.7.6
4245 id : Get-PSModuleSettings
4346 env :
47+ PSMODULE_GET_SETTINGS_INPUT_Name : ${{ inputs.Name }}
4448 PSMODULE_GET_SETTINGS_INPUT_SettingsPath : ${{ inputs.SettingsPath }}
4549 PSMODULE_GET_SETTINGS_INPUT_Debug : ${{ inputs.Debug }}
4650 PSMODULE_GET_SETTINGS_INPUT_Verbose : ${{ inputs.Verbose }}
Original file line number Diff line number Diff line change 11' powershell-yaml' , ' Hashtable' | Install-PSResource - Repository PSGallery - TrustRepository
22
3+ $name = $env: PSMODULE_GET_SETTINGS_INPUT_Name
34$settingsPath = $env: PSMODULE_GET_SETTINGS_INPUT_SettingsPath
45$debug = $env: PSMODULE_GET_SETTINGS_INPUT_Debug
56$verbose = $env: PSMODULE_GET_SETTINGS_INPUT_Verbose
@@ -10,6 +11,7 @@ $workingDirectory = $env:PSMODULE_GET_SETTINGS_INPUT_WorkingDirectory
1011LogGroup ' Inputs' {
1112 [pscustomobject ]@ {
1213 PWD = (Get-Location ).Path
14+ Name = $name
1315 SettingsPath = $settingsPath
1416 } | Format-List | Out-String
1517}
@@ -71,17 +73,20 @@ if (![string]::IsNullOrEmpty($settingsPath) -and (Test-Path -Path $settingsPath)
7173
7274LogGroup ' Name' {
7375 [pscustomobject ]@ {
76+ InputName = $name
7477 SettingsName = $settings.Name
7578 RepositoryName = $env: GITHUB_REPOSITORY_NAME
7679 } | Format-List | Out-String
7780
78- if (! [string ]::IsNullOrEmpty($settings.Name )) {
81+ if (! [string ]::IsNullOrEmpty($name )) {
82+ Write-Host " Using name from input parameter: [$name ]"
83+ } elseif (! [string ]::IsNullOrEmpty($settings.Name )) {
7984 $name = $settings.Name
85+ Write-Host " Using name from settings file: [$name ]"
8086 } else {
8187 $name = $env: GITHUB_REPOSITORY_NAME
88+ Write-Host " Using repository name: [$name ]"
8289 }
83-
84- Write-Host " Using [$name ] as the module name."
8590}
8691
8792$settings = [pscustomobject ]@ {
You can’t perform that action at this time.
0 commit comments