Skip to content

Commit af57ad0

Browse files
committed
Fix release.ps1 script
1 parent ca1b955 commit af57ad0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

release.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
Write-Output 'Generating release notes ...'
22
#region GitHub release notes
3-
$previousRelease = (Invoke-RestMethod -Uri "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/releases/latest?access_token=$env:GITHUB_ACCESS_TOKEN")
4-
$compare = (Invoke-RestMethod -Uri "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/compare/$($previousRelease.target_commitish)...$env:APPVEYOR_REPO_COMMIT`?access_token=$env:GITHUB_ACCESS_TOKEN")
3+
$previousRelease = (Invoke-RestMethod -Uri "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/releases/latest?access_token=$env:GITHUB_ACCESS_TOKEN" -Verbose)
4+
$compare = (Invoke-RestMethod -Uri "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/compare/$($previousRelease.target_commitish)...$env:APPVEYOR_REPO_COMMIT`?access_token=$env:GITHUB_ACCESS_TOKEN" -Verbose)
55
$releaseNotes = "## Release Notes`n#### Version [$env:APPVEYOR_REPO_TAG_NAME](https://github.com/$env:APPVEYOR_REPO_NAME/tree/$env:APPVEYOR_REPO_TAG_NAME)`n"
6+
$commits = $compare.commits | Sort-Object -Property @{Expression={$_.commit.author.date};} -Descending | Select-Object -SkipLast 1
67

7-
if($null -ne $compare.commits -and $compare.commits.Length -gt 0) {
8+
if($null -ne $commits -and $commits.Length -gt 0) {
89
$releaseNotes += "`nCommit | Description`n--- | ---`n"
910
$contributions = @{}
10-
$compare.commits | Sort-Object -Property @{Expression={$_.commit.author.date};} -Descending | ForEach-Object {
11+
$commits | ForEach-Object {
1112
$commitMessage = $_.commit.message.Replace("`r`n"," ").Replace("`n"," ");
1213
if ($commitMessage.ToLower().StartsWith('merge') -or
1314
$commitMessage.ToLower().StartsWith('merging') -or

0 commit comments

Comments
 (0)