You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it turns out that symfony console based apps don't auto-enable syntax coloring.
initially I had reported this issue on composer/composer#9269 but jordi would instead want a fix in symfony/console and/or Github Actions instead.
therefore I also opened a issue on the Github actions runner, without feedback yet though actions/runner#750
imply --ansi when false !== getenv('GITHUB_ACTION')
Is there a way we could auto-detect color support without building a workaround specific to GitHub actions? I understand that this is kind of what you're asking in actions/runner#750 already.
I don't feel confident about solely relying on that env variable. One scenario I could imagine here: You would use the Process component to run another Symfony Console based tool (e.g. your tool calls Composer for certain tasks). In that case the env variable would still be set, but auto-enabling color output is probably not desirable in that context.
env-based detection are a bad idea. they would break scripts running things like some-comment > output.txt, as it would consider that output.txt supports ANSI colors...
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 4.x
Description
Github Actions added support for ansi colors recently.
it turns out that symfony console based apps don't auto-enable syntax coloring.
initially I had reported this issue on composer/composer#9269 but jordi would instead want a fix in symfony/console and/or Github Actions instead.
therefore I also opened a issue on the Github actions runner, without feedback yet though
actions/runner#750
to get fancy colors on github actions, we need to manually enable
..ansi
which is tedious:see e.g. https://github.com/redaxo/redaxo/pull/3939/files
How to reproduce
run
composer install
within a github actionPossible Solution
imply
--ansi
whenfalse !== getenv('GITHUB_ACTION')
Additional context
people work arround this problem by sprinkling additional
--ansi
flags across all the php based tools invoked within github action already, see e.g. https://tomasvotruba.com/blog/2020/09/28/how-to-add-colors-to-continuious-integration-output/The text was updated successfully, but these errors were encountered: