From 839ef35dc1d72bb6eceac9fa809f095e2edcd12b Mon Sep 17 00:00:00 2001 From: rdrll <13176405+rdrll@users.noreply.github.com> Date: Fri, 30 Jun 2023 07:07:42 -0700 Subject: [PATCH] CI Test: Deprecating 'set-output' command (#3757) --- CHANGES.md | 2 ++ scripts/diff_shades_gha_helper.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index ba7947a..d7928a3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -70,6 +70,8 @@ - Update GitHub Action to display black output in the job summary (#3688) +- Deprecated `set-output` command in CI test to keep up to date with GitHub's + deprecation announcement (#3757) ### Documentation diff --git a/scripts/diff_shades_gha_helper.py b/scripts/diff_shades_gha_helper.py index b5fea5a..994fbe0 100644 --- a/scripts/diff_shades_gha_helper.py +++ b/scripts/diff_shades_gha_helper.py @@ -52,7 +52,13 @@ def set_output(name: str, value: str) -> None: print(f"[INFO]: setting '{name}' to '{value}'") else: print(f"[INFO]: setting '{name}' to [{len(value)} chars]") - print(f"::set-output name={name}::{value}") + + # Originally the `set-output` workflow command was used here, now replaced + # by setting variables through the `GITHUB_OUTPUT` environment variable + # to stay up to date with GitHub's update. + if "GITHUB_OUTPUT" in os.environ: + with open(os.environ["GITHUB_OUTPUT"], "a") as f: + print(f"{name}={value}", file=f) def http_get(url: str, *, is_json: bool = True, **kwargs: Any) -> Any: -- 2.39.5