-
Notifications
You must be signed in to change notification settings - Fork 67
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
colors doesn't work on github actions out of the box #130
Comments
@os14 this is intentional, GitHub Actions and other CIs export |
I found that, in GitHub Actions at least, all it takes is I tested the logics here:
Using the following snippet: // fatih/color
white := color.New(color.FgBlue)
boldWhite := white.Add(color.Bold)
boldWhite.Println("Colors using fatih/color")
// charmbracelet/log
logger := log.New(os.Stdout)
logger.Info("Colors using charmbracelet/log")
if isatty.IsTerminal(os.Stdout.Fd()) {
fmt.Println("IsTerminal: true")
} else {
fmt.Println("IsTerminal: false")
}
fmt.Printf("TERM: %s\n", os.Getenv("TERM"))
fmt.Printf("CI: %s\n", os.Getenv("CI"))
fmt.Printf("CLICOLOR_FORCE: %s\n", os.Getenv("CLICOLOR_FORCE")) and adding the following to the Github Actions step, more info on that here: shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"' Here are the results: |
Is your feature request related to a problem? Please describe.
we have a cli tool that uses charmbracelet/log for logging, locally it prints nice colors, but in github actions terminal it doesn't print colors.
Describe the solution you'd like
perhaps the issue is on github side but i would like to get a workaround for this or ideally make it works out of the box.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
local:
github actions:
The text was updated successfully, but these errors were encountered: