Skip to content

Commit

Permalink
Align with vstest release notes script
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed Dec 2, 2022
1 parent e26202a commit a09511f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions scripts/write-release-notes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,19 @@ $repoUrl = $(if ((git -C $Path remote -v) -match "upstream") {
# For stable release we choose only tags without any dash, for pre-release we choose all tags.
$tags = git -C $Path tag -l --sort=refname | Where-Object { $_ -match "v\d+\.\d+\.\d+.*" -and (-not $Stable -or $_ -notlike '*-*') }

$HasPackageVersion = ![string]::IsNullOrWhiteSpace($PackageVersion)

if ($HasPackageVersion) {
if ([string]::IsNullOrWhiteSpace($PackageVersion)) {
# normally we show changes between the latest two tags
$start, $end = $tags | Select-Object -Last 2
Write-Host "$start -- $end"
$tag = $end
}
else {
# in CI we don't have the tag yet, so we show changes between the most recent tag, and this commit
# we figure out the tag from the package version that is set by vsts-prebuild
$start = $tags | Select-Object -Last 1
$end = git -C $Path rev-parse HEAD
$tag = "v$PackageVersion"
}
else {
# normally we show changes between the latest two tags
$start, $end = $tags | Select-Object -Last 2
Write-Host "$start -- $end"
$tag = $end
}

# # override the tags to use if you need
# $start = "v16.8.0-preview-20200812-03"
Expand Down

0 comments on commit a09511f

Please sign in to comment.