Skip to content

Commit 60f3506

Browse files
GitHub usernames are case-insensitive but case preserving. This fixes the issue where setting GITHUB_USER to the same characters in a different case, causes the spurious error: "the specified owner <username> doesn't match the identity associated with the given token"
1 parent 1d532ae commit 60f3506

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

github/client_repositories_user.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"errors"
2222
"fmt"
23+
"strings"
2324

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

111-
if ref.GetIdentity() != idRef.GetIdentity() {
112+
if strings.EqualFold(ref.GetIdentity(), idRef.GetIdentity()) {
112113
return nil, gitprovider.NewErrIncorrectUser(ref.GetIdentity())
113114
}
114115

0 commit comments

Comments
 (0)