Skip to content
Open
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
4 changes: 3 additions & 1 deletion github/client_repositories_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"errors"
"fmt"
"strings"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down Expand Up @@ -108,7 +109,8 @@ func (c *UserRepositoriesClient) Create(ctx context.Context,
return nil, fmt.Errorf("unable to get owner from API")
}

if ref.GetIdentity() != idRef.GetIdentity() {
// GitHub usernames are case insensitive, so compare them with https://pkg.go.dev/strings#EqualFold
if !strings.EqualFold(ref.GetIdentity(), idRef.GetIdentity()) {
return nil, gitprovider.NewErrIncorrectUser(ref.GetIdentity())
}

Expand Down