Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions action/pipeline/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,14 @@ func formatStepIdentifier(stageName, stepName string, isSecret bool) string {
output := strings.Builder{}

if stageName != "" {
output.WriteString(fmt.Sprintf(stagePrefix, stageName))
fmt.Fprintf(&output, stagePrefix, stageName)
}

if stepName != "" {
if isSecret {
output.WriteString(fmt.Sprintf(secretPrefix, stepName))
fmt.Fprintf(&output, secretPrefix, stepName)
} else {
output.WriteString(fmt.Sprintf(stepPrefix, stepName))
fmt.Fprintf(&output, stepPrefix, stepName)
}
}

Expand Down
1 change: 0 additions & 1 deletion action/secret/add.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: Apache-2.0

//nolint:dupl // ignore similar code among actions
package secret

import (
Expand Down
1 change: 0 additions & 1 deletion action/secret/update.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: Apache-2.0

//nolint:dupl // ignore similar code among actions
package secret

import (
Expand Down
7 changes: 6 additions & 1 deletion internal/output/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package output

import (
"bytes"
"math"
"os"

chroma "github.com/alecthomas/chroma/v2/quick"
Expand Down Expand Up @@ -78,7 +79,11 @@ func shouldEnableColor(c *cli.Command) bool {
}

// 5. If not a terminal, don't use color by default
if !term.IsTerminal(int(os.Stdout.Fd())) {
fd := os.Stdout.Fd()

// maxInt is the largest value that fits in an int for the current arch.
maxInt := uintptr(math.MaxInt)
if fd > maxInt || !term.IsTerminal(int(fd)) {
logrus.Debug("no TTY, colors will be suppressed")

return false
Expand Down