diff --git a/eng/common/pipelines/templates/steps/verify-changelog.yml b/eng/common/pipelines/templates/steps/verify-changelog.yml index f90238471d95e..914adcc660e8e 100644 --- a/eng/common/pipelines/templates/steps/verify-changelog.yml +++ b/eng/common/pipelines/templates/steps/verify-changelog.yml @@ -12,13 +12,13 @@ parameters: steps: - task: Powershell@2 inputs: - filePath: /eng/common/scripts/Verify-ChangeLog.ps1 + filePath: $(Build.SourcesDirectory)/eng/common/scripts/Verify-ChangeLog.ps1 arguments: > -PackageName ${{ parameters.PackageName }} -ServiceName ${{ parameters.ServiceName }} -RepoRoot $(Build.SourcesDirectory) -RepoName $(Build.Repository.Name) - -ForRelease ${{ parameters.ForRelease }} + -ForRelease $${{ parameters.ForRelease }} pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: Verify ChangeLog / Release Notes diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index 1f9991bfd6688..8192017a3efb3 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -19,4 +19,4 @@ if ([System.String]::IsNullOrEmpty($Language)) } $PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot -Confirm-ChangeLog -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgReadMePath -ForRelease $ForRelease \ No newline at end of file +Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease \ No newline at end of file diff --git a/eng/common/scripts/modules/ChangeLog-Operations.psm1 b/eng/common/scripts/modules/ChangeLog-Operations.psm1 index 5279668412b70..5c173876124ea 100644 --- a/eng/common/scripts/modules/ChangeLog-Operations.psm1 +++ b/eng/common/scripts/modules/ChangeLog-Operations.psm1 @@ -85,9 +85,9 @@ function Confirm-ChangeLogEntry { [boolean]$ForRelease = $false ) - $changeLogEntries = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString + $changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString - if ([System.String]::IsNullOrEmpty($changeLogEntries.ReleaseStatus)) { + if ([System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus)) { Write-Host ("##[error]Changelog '{0}' has wrong release note title" -f $ChangeLogLocation) Write-Host "##[info]Ensure the release date is included i.e. (yyyy-MM-dd) or (Unreleased) if not yet released" exit 1 @@ -95,19 +95,20 @@ function Confirm-ChangeLogEntry { if ($ForRelease -eq $True) { $CurrentDate = Get-Date -Format "yyyy-MM-dd" - if ($changeLogEntries.ReleaseStatus -ne "($CurrentDate)") { + if ($changeLogEntry.ReleaseStatus -ne "($CurrentDate)") { Write-Host ("##[warning]Incorrect Date: Please use the current date in the Changelog '{0}' before releasing the package" -f $ChangeLogLocation) exit 1 } - if ([System.String]::IsNullOrWhiteSpace($changeLogEntries.ReleaseContent)) { + if ([System.String]::IsNullOrWhiteSpace($changeLogEntry.ReleaseContent)) { Write-Host ("##[error]Empty Release Notes for '{0}' in '{1}'" -f $VersionString, $ChangeLogLocation) Write-Host "##[info]Please ensure there is a release notes entry before releasing the package." exit 1 } } - Write-Host ($changeLogEntries | Format-Table | Out-String) + Write-Host $changeLogEntry.ReleaseTitle + Write-Host $changeLogEntry.ReleaseContent } Export-ModuleMember -Function 'Get-ChangeLogEntries'