Skip to content

Commit a54a29a

Browse files
Use case-insensitive matching for Git error "Not a valid object name" (#389)
1 parent f350a41 commit a54a29a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

providers/gitops/gitops.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func (g *GitClient) getBranchWorkflow(ctx context.Context, clonePath string, bra
262262
lsOutput, err := g.Command.Run(ctx, "git", []string{"ls-tree", "-r", ref, "--full-tree", ".github/workflows"}, clonePath)
263263
if err != nil {
264264
// If the directory doesn’t exist, skip.
265-
if strings.Contains(err.Error(), "Not a valid object name") ||
265+
if strings.Contains(strings.ToLower(err.Error()), "not a valid object name") ||
266266
strings.Contains(err.Error(), "did not match any file") {
267267
return nil, nil
268268
}

0 commit comments

Comments
 (0)