@@ -43,7 +43,7 @@ function Resolve-WorkflowEventRouting {
4343 $isClosedPR = $isPR -and $EventAction -eq ' closed'
4444 $isAbandonedPR = $isClosedPR -and -not $PullRequestIsMerged
4545 $isMergedPR = $isClosedPR -and $PullRequestIsMerged
46- $shouldPrerelease = $isOpenOrLabeledPR -and $HasPrereleaseLabel -and $HasImportantChanges
46+ $shouldPrerelease = $isOpenOrUpdatedPR -and $HasPrereleaseLabel -and $HasImportantChanges
4747 $shouldRelease = (
4848 ($IsPushToDefaultBranch -or $IsManualDispatchToDefaultBranch ) -and
4949 $HasImportantChanges
@@ -86,8 +86,9 @@ function Resolve-PSModulePublishSetting {
8686
8787 . DESCRIPTION
8888 Applies Process-PSModule defaults while preserving every consumer-provided
89- publication and release-label mapping. Rejects the removed AutoPatching
90- setting and invalid DefaultBump values with migration guidance.
89+ publication and release-label mapping. Rejects the removed AutoPatching,
90+ unknown settings, and invalid DefaultBump values. Records the default's
91+ source for the downstream release decision.
9192
9293 . OUTPUTS
9394 System.Management.Automation.PSCustomObject
@@ -132,7 +133,7 @@ function Resolve-PSModulePublishSetting {
132133 )
133134 }
134135
135- [pscustomobject ]@ {
136+ $resolved = [pscustomobject ]@ {
136137 Skip = $PublishModule.Skip ?? $false
137138 AutoCleanup = $PublishModule.AutoCleanup ?? $true
138139 DefaultBump = $defaultBump
@@ -148,6 +149,15 @@ function Resolve-PSModulePublishSetting {
148149 UsePRBodyAsReleaseNotes = $PublishModule.UsePRBodyAsReleaseNotes ?? $true
149150 UsePRTitleAsNotesHeading = $PublishModule.UsePRTitleAsNotesHeading ?? $true
150151 }
152+
153+ $allowedProperties = @ ($resolved.PSObject.Properties.Name ) + ' ReleaseType'
154+ $unknownProperties = @ ($propertyNames | Where-Object { $_ -notin $allowedProperties })
155+ if ($unknownProperties.Count -gt 0 ) {
156+ throw " Publish.Module contains unsupported settings: [$ ( $unknownProperties -join ' , ' ) ]."
157+ }
158+ $source = if ($hasDefaultBump ) { ' Publish.Module.DefaultBump' } else { ' SharedDefault' }
159+ $resolved | Add-Member - NotePropertyName DefaultBumpSource - NotePropertyValue $source
160+ $resolved
151161}
152162
153163function Select-PullRequestForPush {
@@ -189,11 +199,11 @@ function Get-DiscardedReleasePullRequest {
189199 Select-PullRequestForPush returns nothing both when a commit has no associated pull request
190200 and when every associated pull request fails its criteria. Only the first case is safe: a
191201 commit pushed directly to the default branch has no label to honour, so the direct-release
192- path applies the default patch bump .
202+ path applies the effective DefaultBump .
193203
194204 The unsafe case is a pull request that was merged into the default branch, and therefore
195205 carries the version label that was meant to drive the release, but was not selected because
196- its merge commit does not match the commit being released. Falling back to a patch bump
206+ its merge commit does not match the commit being released. Falling back to DefaultBump
197207 there publishes a version nobody asked for, and a PowerShell Gallery version cannot be
198208 reclaimed, so the caller must fail instead.
199209
@@ -249,9 +259,9 @@ function Resolve-ReleasePullRequest {
249259 that merge is still the tip. Rerun the original workflow's failed jobs for an older commit.
250260
251261 When no pull request is selected, the outcome depends on why. A commit pushed directly to
252- the default branch has no label to honour , so the release proceeds with the default patch
253- bump . A commit associated with a merged default-branch pull request that does not match it
254- does carry a label, and applying a patch bump would publish a version nobody asked for .
262+ the default branch has no label to honor , so the release proceeds with the effective
263+ DefaultBump . A commit associated with a merged default-branch pull request that does not
264+ match it carries a label, and applying a default would discard that release intent .
255265 That case throws for an important default-branch push or a recovery dispatch, but not for a
256266 documentation-only push that cannot publish.
257267
@@ -336,7 +346,7 @@ function Resolve-ReleasePullRequest {
336346 " Commit [$CommitSha ] cannot be released because its version label cannot be determined. " +
337347 ' The following merged pull request(s) are associated with it but none matches the commit ' +
338348 " being released: $ ( $discarded -join ' ; ' ) . " +
339- ' Refusing to fall back to a patch bump , because a wrong version published to the ' +
349+ ' Refusing to discard the release intent and apply DefaultBump , because a wrong version published to the ' +
340350 ' PowerShell Gallery cannot be reclaimed. Rerun the original workflow for the intended merge commit. ' +
341351 ' A default-branch dispatch can recover that commit only while it is still the branch tip.'
342352 )
0 commit comments