File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 176176desc 'Update release notes'
177177task :notes do
178178 tag_sort = -> ( tag1 , tag2 ) do
179- tag1_numbers = tag1 . match ( /\. ?v(\d +\. \d +\. \d +)$/ ) [ 1 ] . split ( '.' ) . map! { | n | n . to_i }
180- tag2_numbers = tag2 . match ( /\. ?v(\d +\. \d +\. \d +)$/ ) [ 1 ] . split ( '.' ) . map! { | n | n . to_i }
179+ tag1_numbers = tag1 . match ( /\. ?v(\d +\. \d +\. \d +)$/ ) [ 1 ] . split ( '.' ) . map! ( & : to_i)
180+ tag2_numbers = tag2 . match ( /\. ?v(\d +\. \d +\. \d +)$/ ) [ 1 ] . split ( '.' ) . map! ( & : to_i)
181181 tag1_numbers <=> tag2_numbers
182182 end
183183
@@ -213,7 +213,16 @@ task :notes do
213213 # use first 7 chars to match GitHub
214214 comment = line . gsub ( hex , '' ) . strip
215215 next if comment == 'Update release notes'
216- new_data += "- [#{ hex [ 0 ...7 ] } ](https://github.com/appium/#{ gh_name } /commit/#{ hex } ) #{ comment } \n "
216+
217+ issue_num = comment . slice ( /\( #[0-9]+\) / )
218+ # If the issue_num is pull request, GitHub redirects to the pull request.
219+ comment_note = if issue_num
220+ issue_num . gsub! ( /[(#)]/ , '' )
221+ "[#{ comment } ](https://github.com/appium/#{ gh_name } /issues/#{ issue_num } )"
222+ else
223+ comment
224+ end
225+ new_data += "- [#{ hex [ 0 ...7 ] } ](https://github.com/appium/#{ gh_name } /commit/#{ hex } ) #{ comment_note } \n "
217226 end
218227 data = new_data + "\n "
219228
You can’t perform that action at this time.
0 commit comments