From fae04037d4ad97c77b1f2ce5b61e3b1624102281 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Fri, 7 Feb 2025 14:31:22 +0100 Subject: [PATCH 1/2] fix: get-changelog support for cross-repo links --- updater/scripts/get-changelog.ps1 | 8 ++++---- updater/tests/get-changelog.Tests.ps1 | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/updater/scripts/get-changelog.ps1 b/updater/scripts/get-changelog.ps1 index 8be945f..d7ae438 100644 --- a/updater/scripts/get-changelog.ps1 +++ b/updater/scripts/get-changelog.ps1 @@ -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 @@ -41,7 +41,7 @@ finally } $foundFirst = $false -$changelog = "" +$changelog = '' for ($i = 0; $i -lt $lines.Count; $i++) { $line = $lines[$i] @@ -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 '(? Date: Fri, 7 Feb 2025 14:32:53 +0100 Subject: [PATCH 2/2] chore: changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7104b20..afb7fcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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