Skip to content

Commit

Permalink
Merge pull request #85 from NathanVaughn/feature/azure-pipelines-logging
Browse files Browse the repository at this point in the history
Add support for Azure Pipelines logging commands
  • Loading branch information
NathanVaughn authored Mar 1, 2025
2 parents fef83ce + 9d261ae commit 96130aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "vscode-task-runner"
version = "1.3.4"
version = "1.3.5"
description = "Task runner for VS Code tasks.json"
readme = "README.md"
authors = [{ name = "Nathan Vaughn", email = "[email protected]" }]
Expand Down
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vscode_task_runner/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import colorama

IS_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"
IS_AZURE_PIPELINES = os.getenv("TF_BUILD") == "true"


def _print_flush(msg: str) -> None:
Expand Down Expand Up @@ -35,6 +36,8 @@ def error(msg: str) -> None:
"""
if IS_GITHUB_ACTIONS:
_print_flush(f"::error::{msg}")
elif IS_AZURE_PIPELINES:
_print_flush(f"##vso[task.logissue type=error]{msg}")
else:
_print_flush(f"{red(msg)}")

Expand Down Expand Up @@ -66,6 +69,8 @@ def start_group(name: str) -> None:
"""
if IS_GITHUB_ACTIONS:
_print_flush(f"::group::{name}")
elif IS_AZURE_PIPELINES:
_print_flush(f"##[group]{name}")


def end_group() -> None:
Expand All @@ -74,6 +79,8 @@ def end_group() -> None:
"""
if IS_GITHUB_ACTIONS:
_print_flush("::endgroup::")
elif IS_AZURE_PIPELINES:
_print_flush("##[endgroup]")


@contextmanager
Expand Down

0 comments on commit 96130aa

Please sign in to comment.