Skip to content

Commit

Permalink
Send GHA annotations to stderr
Browse files Browse the repository at this point in the history
Fixes: #3253
  • Loading branch information
ssbarnea committed Apr 14, 2023
1 parent 80598ab commit 90a0533
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ansiblelint/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,14 @@ def render_matches(self, matches: list[MatchError]) -> None:

# If run under GitHub Actions we also want to emit output recognized by it.
if os.getenv("GITHUB_ACTIONS") == "true" and os.getenv("GITHUB_WORKFLOW"):
_logger.info(
"GitHub Actions environment detected, adding annotations output..."
)
formatter = formatters.AnnotationsFormatter(self.options.cwd, True)
for match in itertools.chain(fatal_matches, ignored_matches):
console.print(formatter.format(match), markup=False, highlight=False)
console_stderr.print(
formatter.format(match), markup=False, highlight=False
)

# If sarif_file is set, we also dump the results to a sarif file.
if self.options.sarif_file:
Expand Down

0 comments on commit 90a0533

Please sign in to comment.