From a6a67b0524ec3f8da96143cdf5094b5eaf7d820d Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Wed, 25 Oct 2023 13:09:49 +0900 Subject: [PATCH] Do not append latest_date to gems/bundled_gems [ci skip] --- .github/workflows/bundled_gems.yml | 2 +- tool/update-bundled_gems.rb | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml index 1827420154..077031843f 100644 --- a/.github/workflows/bundled_gems.yml +++ b/.github/workflows/bundled_gems.yml @@ -53,7 +53,7 @@ jobs: - name: Update bundled gems list id: bundled_gems run: | - ruby -i~ tool/update-bundled_gems.rb gems/bundled_gems > $GITHUB_OUTPUT + ruby -i~ tool/update-bundled_gems.rb gems/bundled_gems - name: Maintain updated gems list in NEWS run: | diff --git a/tool/update-bundled_gems.rb b/tool/update-bundled_gems.rb index fbba589cd6..6b40595960 100755 --- a/tool/update-bundled_gems.rb +++ b/tool/update-bundled_gems.rb @@ -2,10 +2,14 @@ BEGIN { require 'rubygems' date = nil - stdout = $> + if ENV.key?('GITHUB_OUTPUT') + output = File.open(ENV['GITHUB_OUTPUT'], 'w') + else + output = STDERR + end } END { - stdout.print date.strftime("latest_date=%F") if date + output.print date.strftime("latest_date=%F") if date } unless /^[^#]/ !~ (gem = $F[0]) (gem, src), = Gem::SpecFetcher.fetcher.detect(:latest) {|s|