Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixes

- Don't update from a manually-updated prerelease to a latest stable release that is earlier than the prerelease ([#78](https://github.com/getsentry/github-workflows/pull/78))
- Cross-repo links in changelog notes ([#82](https://github.com/getsentry/github-workflows/pull/82))

## 2.11.0

Expand Down
8 changes: 4 additions & 4 deletions updater/scripts/get-changelog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ try
git clone --depth 1 $RepoUrl $tmpDir

$file = $(Get-ChildItem -Path $tmpDir | Where-Object { $_.Name -match '^changelog(\.md|\.txt|)$' } )
if ("$file" -eq "")
if ("$file" -eq '')
{
Write-Warning "Couldn't find a changelog"
return
Expand All @@ -41,7 +41,7 @@ finally
}

$foundFirst = $false
$changelog = ""
$changelog = ''
for ($i = 0; $i -lt $lines.Count; $i++)
{
$line = $lines[$i]
Expand Down Expand Up @@ -70,11 +70,11 @@ if ($changelog.Length -gt 1)
{
$changelog = "# Changelog`n$changelog"
# Increase header level by one.
$changelog = $changelog -replace "(#+) ", '$1# '
$changelog = $changelog -replace '(^|\n)(#+) ', '$1$2# '
# Remove at-mentions.
$changelog = $changelog -replace '@', ''
# Make PR/issue references into links to the original repository (unless they already are links).
$changelog = $changelog -replace '(?<!\[)#([0-9]+)', ('[#$1](' + $RepoUrl + '/issues/$1)')
$changelog = $changelog -replace '(?<!\[)#([0-9]+)(?![\]0-9])', ('[#$1](' + $RepoUrl + '/issues/$1)')
# Replace any links pointing to github.com so that the target PRs/Issues don't get na notification.
$changelog = $changelog -replace ('\(' + $prefix), '(https://github-redirect.dependabot.com/'
}
Expand Down
18 changes: 18 additions & 0 deletions updater/tests/get-changelog.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,22 @@ Features, fixes and improvements in this release have been contributed by:
throw "Expected changelog to contain message '$msg'"
}
}

It 'supports cross-repo links' {
$actual = & "$PSScriptRoot/../scripts/get-changelog.ps1" `
-RepoUrl 'https://github.com/getsentry/sentry-native' -OldTag '0.7.17' -NewTag '0.7.18'
$expected = @'
## Changelog
### 0.7.18

**Features**:

- Add support for Xbox Series X/S. ([#1100](https://github-redirect.dependabot.com/getsentry/sentry-native/pull/1100))
- Add option to set debug log level. ([#1107](https://github-redirect.dependabot.com/getsentry/sentry-native/pull/1107))
- Add `traces_sampler` ([#1108](https://github-redirect.dependabot.com/getsentry/sentry-native/pull/1108))
- Provide support for C++17 compilers when using the `crashpad` backend. ([#1110](https://github-redirect.dependabot.com/getsentry/sentry-native/pull/1110), [crashpad#116](https://github-redirect.dependabot.com/getsentry/crashpad/pull/116), [mini_chromium#1](https://github-redirect.dependabot.com/getsentry/mini_chromium/pull/1))
'@

$actual | Should -Be $expected
}
}
Loading