From ee4d99fc024f51e866103020102d044b697c7065 Mon Sep 17 00:00:00 2001 From: brogers5 <6869577+brogers5@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:54:42 -0400 Subject: [PATCH] Warn if release notes URL provided by API server does not match the canonical URL --- update.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/update.ps1 b/update.ps1 index 074716c..dcf30cf 100644 --- a/update.ps1 +++ b/update.ps1 @@ -3,7 +3,8 @@ Import-Module au $userAgent = "Update checker of Chocolatey Community Package 'xsplit-vcam'" function global:au_BeforeUpdate ($Package) { - if ([string]::IsNullOrWhiteSpace($Latest.ReleaseNotes)) { + $apiProvidedReleaseNotes = $Latest.ReleaseNotes + if ([string]::IsNullOrWhiteSpace($apiProvidedReleaseNotes)) { Write-Warning 'release_notes_url is not available' Write-Warning 'SplitMediaLabs may not have published release notes yet - consider delaying package release!' Write-Warning 'For now, falling back on redirect from canonical URL' @@ -22,6 +23,12 @@ function global:au_BeforeUpdate ($Package) { if ($packageReleaseNotes -eq $Latest.ReleaseNotes) { Write-Warning 'releaseNotes URL is identical' Write-Warning 'URL may have been reused, or no URL may be available' + + if ($apiProvidedReleaseNotes -ne $Latest.ReleaseNotes) { + Write-Warning 'Please manually review the provided URLs, then edit the package metadata and repack if appropriate:' + Write-Warning "API: '$apiProvidedReleaseNotes'" + Write-Warning "Canonical: '$($Latest.ReleaseNotes)'" + } } #Archive this version for future development, since the vendor does not guarantee perpetual availability