File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ func setupFlags(name string) (*pflag.FlagSet, *options) {
67
67
flags .StringVar (& opts .jsonFile , "jsonfile" ,
68
68
lookEnvWithDefault ("GOTESTSUM_JSONFILE" , "" ),
69
69
"write all TestEvents to file" )
70
- flags .BoolVar (& opts .noColor , "no-color" , color . NoColor , "disable color output" )
70
+ flags .BoolVar (& opts .noColor , "no-color" , defaultNoColor , "disable color output" )
71
71
72
72
flags .Var (opts .hideSummary , "no-summary" ,
73
73
"do not print summary of: " + testjson .SummarizeAll .String ())
@@ -175,6 +175,13 @@ func (o options) Validate() error {
175
175
return nil
176
176
}
177
177
178
+ var defaultNoColor = func () bool {
179
+ if os .Getenv ("GITHUB_ACTIONS" ) == "true" {
180
+ return false
181
+ }
182
+ return color .NoColor
183
+ }()
184
+
178
185
func setupLogging (opts * options ) {
179
186
if opts .debug {
180
187
log .SetLevel (log .DebugLevel )
You can’t perform that action at this time.
0 commit comments