Write to GITHUB_STEP_SUMMARY

This commit is contained in:
jspijker 2023-02-28 11:56:26 +01:00
parent 76a7e667de
commit 87ddb134a4

View File

@ -275,14 +275,11 @@ jobs:
- name: Summarize the used Conan dependencies
shell: python
env:
FULL_INSTALLER_FILENAME: ${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}
run: |
import os
import json
from pathlib import Path
conan_install_info_path = Path("cura_inst/conan_install_info.json")
conan_info = {"installed": []}
if os.path.exists(conan_install_info_path):
@ -290,15 +287,15 @@ jobs:
conan_info = json.load(f)
sorted_deps = sorted([dep["recipe"]["id"] for dep in conan_info["installed"]])
output_env = os.environ["GITHUB_OUTPUT"]
summary_env = os.environ["GITHUB_STEP_SUMMARY"]
content = ""
if os.path.exists(output_env):
with open(output_env, "r") as f:
if os.path.exists(summary_env):
with open(summary_env, "r") as f:
content = f.read()
with open(output_env, "w") as f:
with open(summary_env, "w") as f:
f.write(content)
f.writelines(f"# { os.environ['FULL_INSTALLER_FILENAME'] } uses:\n")
f.writelines("# ${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }} uses:\n")
for dep in sorted_deps:
f.writelines(f"{dep}\n")