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
2 changes: 1 addition & 1 deletion providers/gitops/gitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func (g *GitClient) getBranchWorkflow(ctx context.Context, clonePath string, bra
lsOutput, err := g.Command.Run(ctx, "git", []string{"ls-tree", "-r", ref, "--full-tree", ".github/workflows"}, clonePath)
if err != nil {
// If the directory doesn’t exist, skip.
if strings.Contains(err.Error(), "Not a valid object name") ||
if strings.Contains(strings.ToLower(err.Error()), "not a valid object name") ||
strings.Contains(err.Error(), "did not match any file") {
Comment on lines +265 to 266
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with the codebase pattern (see IsGitRepoUnauthorizedOrNotReachable at line 498 which uses strings.ToLower() for all error pattern matching), consider applying case-insensitive matching to this error message as well. This would make the error handling more consistent and defensive against potential future Git changes.

Suggested change
if strings.Contains(strings.ToLower(err.Error()), "not a valid object name") ||
strings.Contains(err.Error(), "did not match any file") {
lowerErr := strings.ToLower(err.Error())
if strings.Contains(lowerErr, "not a valid object name") ||
strings.Contains(lowerErr, "did not match any file") {

Copilot uses AI. Check for mistakes.
return nil, nil
}
Expand Down