diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-12-22 16:33:44 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-12-22 16:35:07 -0800 |
commit | fe2bcd352899cd402091c2815846d17a0eb1369b (patch) | |
tree | 3b8987b5f81db3a87717f831a03ad4c610d71ac9 /.github | |
parent | 31b29aad27013da64934e4af1aaa8c2be70f02b8 (diff) |
Check `added` for the second sub! properly
Even if the first sub! modifies `news`, when `added` is empty, it always
ended up skipping `File.write("NEWS.md", news)` because of the `next`.
This commit fixes the problem.
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/bundled_gems.yml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml index c273c9d57d..6de4e02de7 100644 --- a/.github/workflows/bundled_gems.yml +++ b/.github/workflows/bundled_gems.yml @@ -81,7 +81,7 @@ jobs: news.sub!(/^\*( +)The following default gems are now bundled gems\.\n+\K(?: \1\*( +).*\n)*/) do mark = "#{$1} *#{$2}" added.map {|g, v|"#{mark}#{g} #{v}\n"}.join("") - end or next if added + end or next unless added.empty? File.write("NEWS.md", news) end shell: ruby {0} |