diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-12-26 15:35:22 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-12-26 15:37:49 +0900 |
commit | 1698010bb12a799f8ceb7202fd0df87cc41c6a48 (patch) | |
tree | 4c59b3e03f45be8f91209bc9cd3761dd4c02334a /.github/workflows/bundled_gems.yml | |
parent | a91605c9dafe70a95a1c4a02f265ba8f3280124b (diff) | |
download | ruby-1698010bb12a799f8ceb7202fd0df87cc41c6a48.tar.gz |
NEWS: Empty gem list if no new gems
Diffstat (limited to '.github/workflows/bundled_gems.yml')
-rw-r--r-- | .github/workflows/bundled_gems.yml | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml index 12fb2b06e5..2a8e6c244c 100644 --- a/.github/workflows/bundled_gems.yml +++ b/.github/workflows/bundled_gems.yml @@ -67,12 +67,14 @@ jobs: [g, v] unless last[g] == v end changed, added = changed.partition {|g, _| last[g]} - news.sub!(/^\*\s+The following #{type} gems? are updated\.(\n\s+\*\s+)\K.*(?:\1.*)*/) do - changed.map {|g, v|"#{g} #{v}"}.join($1) - end or exit - news.sub!(/^\*\s+The following default gems are now bundled.*(\n\s+\*\s+)\K.*(?:\1.*)*/) do - added.map {|g, v|"#{g} #{v}"}.join($1) - end if added + news.sub!(/^\*( +)The following #{type} gems? are updated\.\n\K(?: \1\* .*\n)*/) do + mark = "#{$1} * " + changed.map {|g, v|"#{mark}#{g} #{v}\n"}.join("") + end or next + news.sub!(/^\*( +)The following default gems are now bundled gems\.\n\K(?: \1\* .*\n)*/) do + mark = "#{$1} * " + added.map {|g, v|"#{mark}#{g} #{v}\n"}.join("") + end or next if added File.write("NEWS.md", news) end shell: ruby {0} |