Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Sep 23, 2024
1 parent b1bf36a commit 92f2120
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
13 changes: 6 additions & 7 deletions src/actionman/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"),
Expand All @@ -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
Expand Down

0 comments on commit 92f2120

Please sign in to comment.