Skip to content

Commit a31ad57

Browse files
committed
1 parent e3688b4 commit a31ad57

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/ci_set_matrix.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848
raise
4949

5050

51+
def set_output(name, value):
52+
if "GITHUB_OUTPUT" in os.environ:
53+
with open(os.environ["GITHUB_OUTPUT"], "at") as f:
54+
print(f"{name}={value}", file=f)
55+
else:
56+
print("Would set GitHub actions output {name} to '{value}'")
57+
58+
5159
def set_boards_to_build(build_all):
5260
# Get boards in json format
5361
boards_info_json = build_board_info.get_board_mapping()
@@ -161,7 +169,7 @@ def set_boards_to_build(build_all):
161169

162170
# Set the step outputs for each architecture
163171
for arch in arch_to_boards:
164-
print("::set-output name=boards-" + arch + "::" + json.dumps(sorted(arch_to_boards[arch])))
172+
set_output(f"boards-{arch}", json.dumps(sorted(arch_to_boards[arch])))
165173

166174

167175
def set_docs_to_build(build_all):
@@ -177,7 +185,7 @@ def set_docs_to_build(build_all):
177185

178186
# Set the step outputs
179187
print("Building docs:", doc_match)
180-
print("::set-output name=build-doc::" + str(doc_match))
188+
set_output(f"build-doc", doc_match)
181189

182190

183191
def check_changed_files():

0 commit comments

Comments
 (0)