From 92f2120b50d922a36968e3c71837af509f65246b Mon Sep 17 00:00:00 2001 From: RepoDynamicsBot <80158628+AAriam@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:04:10 +0200 Subject: [PATCH] update --- pyproject.toml | 2 +- src/actionman/log.py | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3e10de7..f88e537 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ namespaces = true # ----------------------------------------- Project Metadata ------------------------------------- [project] -version = "0.0.0.dev15" +version = "0.0.0.dev16" name = "ActionMan" requires-python = ">=3.10" dependencies = [ diff --git a/src/actionman/log.py b/src/actionman/log.py index c6e63c0..c5c583d 100644 --- a/src/actionman/log.py +++ b/src/actionman/log.py @@ -61,7 +61,7 @@ def annotation( column_end: int = 0, console: Console | None = None, out: bool = True, -) -> str: +) -> _Text: """Create a notice, warning, or error annotation. Parameters @@ -101,8 +101,7 @@ def annotation( - [GitHub Docs: Workflow Commands for GitHub Actions: Setting an error message](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message) """ args = locals() - sig = f"::{typ} " - args_added = False + sig = [] for arg_name, github_arg_name in ( ("title", "title"), ("filename", "file"), @@ -112,10 +111,10 @@ def annotation( ("column_end", "endColumn"), ): if args[arg_name]: - sig += f"{github_arg_name}={args[arg_name]}," - args_added = True - sig = sig.removesuffix("," if args_added else " ") - output = _Text(sig) + sig.append(f"{github_arg_name}={args[arg_name]}") + sig_str = ",".join(sig) + sig_section = f" {sig_str}" if sig_str else "" + output = _Text(f"::{typ}{sig_section}::") output.append(message) if out: console = console or DEFAULT_CONSOLE