From ab3b1b23811c44f56f3dff318b08a9112cba3582 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 18 Oct 2022 11:30:56 +0900 Subject: [PATCH] sync_default_gems.rb: fix links to GitHub issues - Substitute `GH-xxxx` which does not contain `#` too. - Split each substitutions. --- tool/sync_default_gems.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index d585f5f14a..a5f8c7fd09 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -422,13 +422,16 @@ def message_filter(repo, sha) log = STDIN.read log.delete!("\r") url = "https://github.com/#{repo}" - print "[#{repo}] ", log.gsub(/\b(?:(?i:fix(?:e[sd])?) +|GH-)\K#(?=\d+\b)|\(\K#(?=\d+\))/) { + log.gsub!(/\b(?:(?i:fix(?:e[sd])?) +)\K#(?=\d+\b)|\bGH-#?(?=\d+\b)|\(\K#(?=\d+\))/) { "#{url}/pull/" - }.gsub(%r{(?