File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ Publishes a pre-versioned PowerShell module artifact to the PowerShell Gallery.
99| ` Name ` | Name of the module to publish. | No | Repository name |
1010| ` ModulePath ` | Path containing the built ` <Name>/ ` module directory. | No | ` outputs/module ` |
1111| ` ArtifactName ` | Name of the module artifact to download. | No | ` module ` |
12- | ` APIKey ` | PowerShell Gallery API key supplied from the caller's ` PSGALLERY_API_KEY ` secret . | Yes | N/A |
12+ | ` PSGALLERY_API_KEY ` | PowerShell Gallery API key. | Yes | N/A |
1313| ` WhatIf ` | Logs publishing operations without publishing the module. | No | ` false ` |
1414| ` WorkingDirectory ` | Directory where the publishing script runs. | No | ` . ` |
1515
@@ -26,7 +26,7 @@ This action does not provide outputs.
2626 Name : ExampleModule
2727 ModulePath : outputs/module
2828 ArtifactName : module
29- APIKey : ${{ secrets.PSGALLERY_API_KEY }}
29+ PSGALLERY_API_KEY : ${{ secrets.PSGALLERY_API_KEY }}
3030` ` `
3131
3232Use [Release-PSModule](../Release-PSModule/README.md) in a separate workflow step to create the GitHub release from the same artifact.
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ inputs:
1010 description : Path to the folder containing the <Name>/ module subdirectory from Build-PSModule.
1111 required : false
1212 default : outputs/module
13- APIKey :
13+ PSGALLERY_API_KEY :
1414 description : PowerShell Gallery API Key.
1515 required : true
1616 WhatIf :
4949 GH_TOKEN : ${{ env.GH_TOKEN }}
5050 PSMODULE_PUBLISH_PSMODULE_INPUT_Name : ${{ inputs.Name }}
5151 PSMODULE_PUBLISH_PSMODULE_INPUT_ModulePath : ${{ inputs.ModulePath }}
52- PSMODULE_PUBLISH_PSMODULE_INPUT_APIKey : ${{ inputs.APIKey }}
52+ PSMODULE_PUBLISH_PSMODULE_INPUT_PSGALLERY_API_KEY : ${{ inputs.PSGALLERY_API_KEY }}
5353 PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf : ${{ inputs.WhatIf }}
5454 run : ${{ github.action_path }}/src/publish.ps1
Original file line number Diff line number Diff line change 11[Diagnostics.CodeAnalysis.SuppressMessageAttribute (
2- ' PSUseDeclaredVarsMoreThanAssignments' , ' apiKey ' ,
2+ ' PSUseDeclaredVarsMoreThanAssignments' , ' psGalleryApiKey ' ,
33 Justification = ' Variable is used in script blocks.'
44)]
55[Diagnostics.CodeAnalysis.SuppressMessageAttribute (
@@ -38,7 +38,7 @@ LogGroup 'Load inputs' {
3838 exit 1
3939 }
4040 $modulePath = Resolve-Path - Path $modulePathCandidate | Select-Object - ExpandProperty Path
41- $apiKey = $env: PSMODULE_PUBLISH_PSMODULE_INPUT_APIKey
41+ $psGalleryApiKey = $env: PSMODULE_PUBLISH_PSMODULE_INPUT_PSGALLERY_API_KEY
4242 $whatIf = $env: PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf -eq ' true'
4343
4444 Write-Host " Module name: [$name ]"
@@ -138,7 +138,7 @@ LogGroup 'Publish to PSGallery' {
138138 Write-Host " Publish-PSResource -Path $modulePath -Repository PSGallery -ApiKey ***"
139139 } else {
140140 try {
141- Publish-PSResource - Path $modulePath - Repository PSGallery - ApiKey $apiKey
141+ Publish-PSResource - Path $modulePath - Repository PSGallery - ApiKey $psGalleryApiKey
142142 } catch {
143143 Write-Error $_.Exception.Message
144144 exit 1
Original file line number Diff line number Diff line change 6161 with :
6262 Name : ${{ fromJson(inputs.Settings).Name }}
6363 ModulePath : outputs/module
64- APIKey : ${{ secrets.PSGALLERY_API_KEY }}
64+ PSGALLERY_API_KEY : ${{ secrets.PSGALLERY_API_KEY }}
6565 WhatIf : ${{ github.repository == 'PSModule/Process-PSModule' }}
6666 WorkingDirectory : ${{ fromJson(inputs.Settings).WorkingDirectory }}
6767
You can’t perform that action at this time.
0 commit comments