From a31ad57225028c46d22e45473df99cf0c03ffd25 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Oct 2022 13:45:30 -0500 Subject: [PATCH] Use non-deprecated way to set build outputs see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ --- tools/ci_set_matrix.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index 90cf04cea6..0ae6010ac9 100644 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -48,6 +48,14 @@ except json.decoder.JSONDecodeError as exc: raise +def set_output(name, value): + if "GITHUB_OUTPUT" in os.environ: + with open(os.environ["GITHUB_OUTPUT"], "at") as f: + print(f"{name}={value}", file=f) + else: + print("Would set GitHub actions output {name} to '{value}'") + + def set_boards_to_build(build_all): # Get boards in json format boards_info_json = build_board_info.get_board_mapping() @@ -161,7 +169,7 @@ def set_boards_to_build(build_all): # Set the step outputs for each architecture for arch in arch_to_boards: - print("::set-output name=boards-" + arch + "::" + json.dumps(sorted(arch_to_boards[arch]))) + set_output(f"boards-{arch}", json.dumps(sorted(arch_to_boards[arch]))) def set_docs_to_build(build_all): @@ -177,7 +185,7 @@ def set_docs_to_build(build_all): # Set the step outputs print("Building docs:", doc_match) - print("::set-output name=build-doc::" + str(doc_match)) + set_output(f"build-doc", doc_match) def check_changed_files():