Skip to content

Commit

Permalink
Format step summary for package-resolver in GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Mar 4, 2025
1 parent 8cf219b commit 036ba7c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dev_scripts/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ def write_gh_summary(filepath: str, text: str) -> None:
text: Text to write to summary.
"""
with open(filepath, "a") as file:
file.write("```")
file.write(text)
file.write("```")
file.write("\n")
file.flush()


def entrypoint():
Expand Down Expand Up @@ -220,12 +224,11 @@ def entrypoint():
if Version(latest_version) > Version(current_version):
version_dict = versioned.__dict__
version_dict.pop("filepath", 1)
string = json.dumps(version_dict, indent=4)
if gha:
write_gh_summary(gha_summary, string)
print(f"::warning title=Outdated Version::{string}", file=sys.stderr)
write_gh_summary(gha_summary, json.dumps(version_dict, indent=4))
print(f"::warning title=Outdated Version::{version_dict}", file=sys.stderr)
else:
echo.warning(string)
echo.warning(json.dumps(version_dict, indent=4))


if __name__ == "__main__":
Expand Down

0 comments on commit 036ba7c

Please sign in to comment.