This repository was archived by the owner on Sep 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class SemanticReleaseNotes
1111 {
1212 //readonly Regex _issueRegex = new Regex(" - (?<Issue>.*?)(?<IssueLink> \\[(?<IssueId>.*?)\\]\\((?<IssueUrl>.*?)\\))*( *\\+(?<Tag>[^ \\+]*))*", RegexOptions.Compiled);
1313 static readonly Regex ReleaseRegex = new Regex ( "# (?<Title>.*?)( \\ ((?<Date>.*?)\\ ))?$" , RegexOptions . Compiled ) ;
14+ static readonly Regex LinkRegex = new Regex ( @"\[(?<Text>.*?)\]\((?<Link>.*?)\)$" , RegexOptions . Compiled ) ;
1415 readonly string [ ] categories ;
1516 readonly SemanticRelease [ ] releases ;
1617
@@ -105,7 +106,14 @@ public static SemanticReleaseNotes Parse(string releaseNotes)
105106 }
106107 else if ( line . StartsWith ( "Commits: " ) )
107108 {
108- var commits = line . Replace ( "Commits: " , string . Empty ) . Split ( new [ ] { "..." } , StringSplitOptions . None ) ;
109+ var commitText = line . Replace ( "Commits: " , string . Empty ) ;
110+ var linkMatch = LinkRegex . Match ( commitText ) ;
111+ if ( linkMatch . Success )
112+ {
113+ commitText = linkMatch . Groups [ "Text" ] . Value ;
114+ currentRelease . DiffInfo . DiffUrlFormat = linkMatch . Groups [ "Link" ] . Value ;
115+ }
116+ var commits = commitText . Split ( new [ ] { "..." } , StringSplitOptions . None ) ;
109117 currentRelease . DiffInfo . BeginningSha = commits [ 0 ] ;
110118 currentRelease . DiffInfo . EndSha = commits [ 1 ] ;
111119 }
You can’t perform that action at this time.
0 commit comments