Skip to content

Commit 538a8b7

Browse files
committed
ci: Enabled colored log output in GitHub Actions
1 parent 252b07b commit 538a8b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bootstrap/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use std::sync::OnceLock;
2626
use std::time::SystemTime;
2727
use std::{env, io, str};
2828

29-
use build_helper::ci::gha;
29+
use build_helper::ci::{gha, CiEnv};
3030
use build_helper::exit;
3131
use sha2::digest::Digest;
3232
use termcolor::{ColorChoice, StandardStream, WriteColor};
@@ -1882,7 +1882,9 @@ to download LLVM rather than building it.
18821882
let choice = match self.config.color {
18831883
flags::Color::Always => ColorChoice::Always,
18841884
flags::Color::Never => ColorChoice::Never,
1885-
flags::Color::Auto if !is_tty => ColorChoice::Never,
1885+
// GitHub Actions does not report itself as a tty session however having colored output
1886+
// there is still useful for visually parsing logs.
1887+
flags::Color::Auto if !is_tty && !CiEnv::is_ci() => ColorChoice::Never,
18861888
flags::Color::Auto => ColorChoice::Auto,
18871889
};
18881890
let mut stream = constructor(choice);

0 commit comments

Comments
 (0)