From 4bb4b1a16aba402db57c2764ec49378774aad88a Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 7 Sep 2021 13:34:46 -0700 Subject: [PATCH] Fix `ReleaseTools` issue matcher regex The simpler "anything but a digit" logic failed on an edge case with a recent PR that had another URL with digits in it after the word "Fix" so we had to make this more explicit. --- tools/ReleaseTools.psm1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/ReleaseTools.psm1 b/tools/ReleaseTools.psm1 index f0e5665323..85ea6ca4a4 100644 --- a/tools/ReleaseTools.psm1 +++ b/tools/ReleaseTools.psm1 @@ -108,7 +108,9 @@ function Get-Bullets { 'resolved' ) - $IssueRegex = '(' + ($CloseKeywords -join '|') + ')\s+(?\D+)(?\d+)' + # NOTE: The URL matcher must be explicit because the body of a PR may + # contain other URLs with digits (like an image asset). + $IssueRegex = '(' + ($CloseKeywords -join '|') + ')\s+((https://github.com/PowerShell/(?(' + ([RepoNames]::Values -join '|') + '))/issues/)|#)(?\d+)' } process {