diff --git a/.github/workflows/Get-Settings.yml b/.github/workflows/Get-Settings.yml index a954ace8..fceff39d 100644 --- a/.github/workflows/Get-Settings.yml +++ b/.github/workflows/Get-Settings.yml @@ -131,7 +131,13 @@ jobs: RepositoryName = $env:GITHUB_REPOSITORY_NAME } | Format-List | Out-String - $name = ![string]::IsNullOrEmpty($inputName) ? $name : ![string]::IsNullOrEmpty($settings.Name) ? $settings.Name : $env:GITHUB_REPOSITORY_NAME + if (![string]::IsNullOrEmpty($inputName)) { + $name = $inputName + } elseif (![string]::IsNullOrEmpty($settings.Name)) { + $name = $settings.Name + } else { + $name = $env:GITHUB_REPOSITORY_NAME + } Write-Host "Using [$name] as the module name." } diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3b0e331a..dc94bd8e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -286,15 +286,13 @@ jobs: - name: Publish module uses: PSModule/Publish-PSModule@v2 + env: + GH_TOKEN: ${{ github.token }} with: Name: ${{ fromJson(needs.Get-Settings.outputs.Settings).Name }} - ModulePath: ${{ inputs.WorkingDirectory }}/outputs/module + ModulePath: outputs/module APIKey: ${{ secrets.APIKEY }} WhatIf: ${{ github.repository == 'PSModule/Process-PSModule' }} - Debug: ${{ inputs.Debug }} - Prerelease: ${{ inputs.Prerelease }} - Verbose: ${{ inputs.Verbose }} - Version: ${{ inputs.Version }} AutoCleanup: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.AutoCleanup }} AutoPatching: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.AutoPatching }} DatePrereleaseFormat: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.DatePrereleaseFormat }} @@ -304,3 +302,4 @@ jobs: MinorLabels: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.MinorLabels }} PatchLabels: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.PatchLabels }} VersionPrefix: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.VersionPrefix }} + WorkingDirectory: ${{ inputs.WorkingDirectory }}