Skip to content

Commit fe47566

Browse files
tablackburnclaude
andcommitted
ci(release): make UpdateReleaseNotes manifest write non-fatal
Backports the guard added during the PlexAutomationToolkit rollout review: the task is documented as non-fatal, but the final Update-ModuleManifest -ErrorAction Stop was unguarded, so a failure (e.g. missing built manifest) would hard-fail Publish. Add a Test-Path check for the built manifest and wrap the update in try/catch that warns and leaves the existing ReleaseNotes in place, keeping the release unblocked as intended. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 641a1e6 commit fe47566

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

build.psake.ps1

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,19 @@ Task -Name 'UpdateReleaseNotes' -Depends 'Build' -Description 'Set built manifes
8282
return
8383
}
8484
$builtManifest = Join-Path -Path $PSBPreference.Build.ModuleOutDir -ChildPath "$($PSBPreference.General.ModuleName).psd1"
85-
Update-ModuleManifest -Path $builtManifest -ReleaseNotes $releaseNotes -ErrorAction Stop
86-
Write-Host " Set ReleaseNotes on built manifest from CHANGELOG [$($releaseEntry.Version)] ($($releaseNotes.Length) chars)" -ForegroundColor Gray
85+
if (-not (Test-Path -Path $builtManifest)) {
86+
Write-Warning "Built manifest not found at '$builtManifest'; leaving ReleaseNotes unchanged."
87+
return
88+
}
89+
try {
90+
Update-ModuleManifest -Path $builtManifest -ReleaseNotes $releaseNotes -ErrorAction Stop
91+
Write-Host " Set ReleaseNotes on built manifest from CHANGELOG [$($releaseEntry.Version)] ($($releaseNotes.Length) chars)" -ForegroundColor Gray
92+
}
93+
catch {
94+
# Keep publishing unblocked: a failure here just leaves the manifest's existing
95+
# ReleaseNotes in place rather than aborting the release.
96+
Write-Warning "Failed to set ReleaseNotes on the built manifest ($($_.Exception.Message)); leaving it unchanged."
97+
}
8798
}
8899

89100
# Inject ReleaseNotes into the built manifest before publishing (PowerShellBuild's Publish

0 commit comments

Comments
 (0)