You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GitHub Actions provide some features to help tools present nicer logs, one of those features are groups (of lines). This is described in the GitHub Workflow Commands reference.
This is how it can look when a single build step built loads of docker files with loads of logs in each. It was somewhat readable still thanks to the grouping. But, with chartpress currently, we don't have such grouping.
Implementation idea
We wrap work to be done for example, to build or push an image, inside a with _gwc_group(f"Building {image}"): scope using the example code below. Note that it checks for if GITHUB_ACTIONS is set or not, that is the indication that we are inside a GitHub actions runner.
importjsonfromcontextlibimportcontextmanagerdef_gwc(command_name, command_value="", **params):
ifnotos.environ.get("GITHUB_ACTIONS"):
return# Assume non-string values are meant to be dumped as JSONifnotisinstance(command_value, str):
command_value=json.dumps(command_value)
print(f"dumped json: {command_value}")
ifparams:
comma_sep_params=",".join([f"{k}={v}"fork, vinparams.items()])
print(f"::{command_name}{comma_sep_params}::{command_value}")
else:
print(f"::{command_name}::{command_value}")
@contextmanagerdef_gwc_group(group_name):
""" Entering the context prints the group command, and exiting the context prints the endgroup command.<< """try:
yield_gwc("group", group_name)
finally:
_gwc("endgroup", group_name)
The text was updated successfully, but these errors were encountered:
Proposed change
GitHub Actions provide some features to help tools present nicer logs, one of those features are groups (of lines). This is described in the GitHub Workflow Commands reference.
This is how it can look when a single build step built loads of docker files with loads of logs in each. It was somewhat readable still thanks to the grouping. But, with chartpress currently, we don't have such grouping.
Implementation idea
We wrap work to be done for example, to build or push an image, inside a
with _gwc_group(f"Building {image}"):
scope using the example code below. Note that it checks for ifGITHUB_ACTIONS
is set or not, that is the indication that we are inside a GitHub actions runner.The text was updated successfully, but these errors were encountered: