Skip to content
Merged
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
8 changes: 7 additions & 1 deletion providers/gitops/gitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package gitops
import (
"bytes"
"context"
"errors"
"fmt"
"github.com/rs/zerolog/log"
"os"
"os/exec"
"strconv"
"strings"
"time"

"github.com/rs/zerolog/log"
)

type GitCloneError struct {
Expand Down Expand Up @@ -76,6 +78,10 @@ func (g *GitClient) Clone(ctx context.Context, clonePath string, url string, tok

for _, c := range commands {
if _, err := g.Command.Run(ctx, c.cmd, c.args, clonePath); err != nil {
if strings.Contains(err.Error(), token) {
return errors.New(strings.ReplaceAll(err.Error(), token, "REDACTED"))
}

return err
}
}
Expand Down