diff --git a/.github/workflows/Plan.yml b/.github/workflows/Plan.yml index 3a25e0f4..6a5f679c 100644 --- a/.github/workflows/Plan.yml +++ b/.github/workflows/Plan.yml @@ -85,6 +85,12 @@ jobs: ImportantFilePatterns: ${{ inputs.ImportantFilePatterns }} - name: Resolve-Version + # Version resolution requires pull_request context (PR labels + head ref decide the + # bump and the prerelease name). Skip it on non-PR events (schedule, workflow_dispatch, + # push): there ReleaseType is 'None', nothing is published, and Enrich-Settings falls + # back to safe empty defaults. Without this gate the action throws on non-PR events and + # fails the whole run. Fixes #373. + if: github.event_name == 'pull_request' uses: PSModule/Resolve-PSModuleVersion@d53326c7687d20a7949d457fccd71223856b1890 # v1.1.0 id: Resolve-Version env: diff --git a/.github/workflows/Test-ModuleLocal.yml b/.github/workflows/Test-ModuleLocal.yml index fa534551..0901d405 100644 --- a/.github/workflows/Test-ModuleLocal.yml +++ b/.github/workflows/Test-ModuleLocal.yml @@ -82,4 +82,4 @@ jobs: WorkingDirectory: ${{ fromJson(inputs.Settings).WorkingDirectory }} Prescript: | # This is to speed up module loading in Pester. Install-PSResource -Repository PSGallery -TrustRepository -Name PSCustomObject - Import-Module -Name '${{ steps.import-module.outputs.name }}' -RequiredVersion '${{ fromJson(inputs.Settings).Module.Version }}' + Import-Module -Name '${{ steps.import-module.outputs.name }}' -RequiredVersion '${{ fromJson(inputs.Settings).Module.Version != '' && fromJson(inputs.Settings).Module.Version || '999.0.0' }}'