Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools repository (#12269)
Browse files Browse the repository at this point in the history
  • Loading branch information
azure-sdk authored Jun 30, 2020
1 parent 9ff3405 commit 73974f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions eng/common/pipelines/templates/steps/verify-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eng/common/scripts/Verify-ChangeLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease
11 changes: 6 additions & 5 deletions eng/common/scripts/modules/ChangeLog-Operations.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,30 @@ 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
}

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'
Expand Down

0 comments on commit 73974f1

Please sign in to comment.