Skip to content

๐Ÿ› GitHub reporter output is invalid when colors are enabledย #9189

@brianhelba

Description

@brianhelba

What happened?

Following the change in #9120, running biome ci now enables the github reporter when the environment contains GITHUB_ACTION=true. However, by default, biome ci still uses color output, which currently breaks the intended functionality.

Specifically, Biome's color output causes lines of github reporter output (written to stdout) to be wrapped with the characters 0x1b 0x5b 0x30 0x6d (or ESC[0m), which is the ANSI escape sequence to "reset all modes (styles and colors)". These extra characters breaks GitHub's ability to process such lines as workflow commands, which defeats the purpose of the github reporter.

Note, if the command is run as biome ci --reporter=default --reporter=github color output is disabled (due to #3281) and the output is correctly detected by GitHub. However, biome ci ought to "just work" too.


I think there are 2 potential fixes:

  1. Make biome ci (when GITHUB_ACTION=true) actually work the same as --reporter=default --reporter=github, which would effectively also set --colors=off, per fix(cli): disable colors when using the github reporterย #3281.
  2. Ensure that the stdout output of the github has "clean" lines with no ANSI control characters. I suspect that control characters could still technically be output by the github reporter (if colors needed to be reset), but they'd have to be on totally separate lines from the actual "workflow commands". Additionally, maybe part of fix(cli): disable colors when using the github reporterย #3281 could actually be reverted, so that when --reporter=default --reporter=github is explicitly enabled, the default reporter could still produce color output.

I think 2 would be the most user-friendly behavior. However, 1 seems easier and would only deprive users of colors when running inside GitHub Actions.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIArea: CLIS-Bug-confirmedStatus: report has been confirmed as a valid bugS-Help-wantedStatus: you're familiar with the code base and want to help the projectgood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions