From 5d9e8f7fa3fc67173d862b5140b16be74c73cda6 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Fri, 27 Jan 2023 20:44:26 +0000 Subject: [PATCH] Replace deprecated set-output with GITHUB_OUTPUT --- .github/workflows/dispatch-build-bottle.yml | 4 ++-- .github/workflows/dispatch-rebottle.yml | 4 ++-- .github/workflows/tests.yml | 4 ++-- cmd/determine-rebottle-runners.rb | 5 ++++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dispatch-build-bottle.yml b/.github/workflows/dispatch-build-bottle.yml index 561f24c51e2..7ad94a3607e 100644 --- a/.github/workflows/dispatch-build-bottle.yml +++ b/.github/workflows/dispatch-build-bottle.yml @@ -151,10 +151,10 @@ jobs: cd bottles count=$(ls *.json | wc -l | xargs echo -n) echo "$count bottles" - echo "::set-output name=count::$count" + echo "count=$count" >> $GITHUB_OUTPUT failures=$(ls failed/*.json | wc -l | xargs echo -n) echo "$failures failed bottles" - echo "::set-output name=failures::$failures" + echo "failures=$failures" >> $GITHUB_OUTPUT - name: Upload failed bottles if: always() && steps.bottles.outputs.failures > 0 diff --git a/.github/workflows/dispatch-rebottle.yml b/.github/workflows/dispatch-rebottle.yml index 40838993a61..41a24c54678 100644 --- a/.github/workflows/dispatch-rebottle.yml +++ b/.github/workflows/dispatch-rebottle.yml @@ -22,7 +22,7 @@ on: description: "Whether to fail immediately on a single OS version failure (default: true)" default: "true" required: false - + permissions: contents: read @@ -139,7 +139,7 @@ jobs: cd bottles count=$(ls *.json | wc -l | xargs echo -n) echo "$count bottles" - echo "::set-output name=count::$count" + echo "count=$count" >> $GITHUB_OUTPUT - name: Upload bottles to GitHub Actions if: always() && steps.bottles.outputs.count > 0 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c6b5e2ad590..c629b391eb1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -299,10 +299,10 @@ jobs: cd bottles count=$(ls *.json | wc -l | xargs echo -n) echo "$count bottles" - echo "::set-output name=count::$count" + echo "count=$count" >> $GITHUB_OUTPUT failures=$(ls failed/*.json | wc -l | xargs echo -n) echo "$failures failed bottles" - echo "::set-output name=failures::$failures" + echo "failures=$failures" >> $GITHUB_OUTPUT - name: Upload failed bottles if: always() && steps.bottles.outputs.failures > 0 diff --git a/cmd/determine-rebottle-runners.rb b/cmd/determine-rebottle-runners.rb index 068898b504c..0892d9092b7 100755 --- a/cmd/determine-rebottle-runners.rb +++ b/cmd/determine-rebottle-runners.rb @@ -84,6 +84,9 @@ module Homebrew end end.compact - puts "::set-output name=runners::#{runners.to_json}" + github_output = ENV.fetch("GITHUB_OUTPUT") { raise "GITHUB_OUTPUT is not defined" } + File.open(github_output, "a") do |f| + f.puts("runners=#{runners.to_json}") + end end end