Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colored output on GitHub Actions not enabled per default #227

Closed
mowies opened this issue Jan 3, 2022 · 1 comment · Fixed by #243
Closed

Colored output on GitHub Actions not enabled per default #227

mowies opened this issue Jan 3, 2022 · 1 comment · Fixed by #243
Labels
enhancement New feature or request

Comments

@mowies
Copy link

mowies commented Jan 3, 2022

I am using gotestsum inside GitHub actions to run some unit tests and noticed that the output is not colored per default. This is probably because gotestsum is not directly outputting to a real terminal. (Reference from fatih/color readme)

I needed to set --no-color=false to get it working which is not very intuitive.

I suggest to check for common CI environment variables like $GITHUB_ACTIONS for GitHub Actions and decide whether colored output should be enabled based on those variables.

@dnephin dnephin added the enhancement New feature or request label Jan 4, 2022
@dnephin
Copy link
Member

dnephin commented Jan 4, 2022

Thank you for opening this issue! I've mostly been using CircleCI to run tests, and github actions for other types of automation, so I had not noticed this yet. I believe CircleCI uses a pseudo terminal so that most commands believe they are running in a regular terminal and use color.

I like the idea of defaulting to color enabled in this environment, but I think we need to be careful to not assume all CI environments will support color. Checking if GITHUB_ACTIONS is set sounds like a good approach to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants