Skip to content

Commit bd19859

Browse files
fix(github): get correct owner name
1 parent 3e5a588 commit bd19859

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/provider/github/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (repo *GitHubRepository) GetInfo() (*provider.RepositoryInfo, error) {
5252
return nil, err
5353
}
5454
return &provider.RepositoryInfo{
55-
Owner: r.GetOwner().GetName(),
55+
Owner: r.GetOwner().GetLogin(),
5656
Repo: r.GetName(),
5757
DefaultBranch: r.GetDefaultBranch(),
5858
Private: r.GetPrivate(),

pkg/provider/github/github_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ var (
5454
GITHUB_REPO_PRIVATE = true
5555
GITHUB_DEFAULTBRANCH = "master"
5656
GITHUB_REPO_NAME = "test-repo"
57-
GITHUB_OWNER_NAME = "owner"
57+
GITHUB_OWNER_LOGIN = "owner"
5858
GITHUB_REPO = github.Repository{
5959
DefaultBranch: &GITHUB_DEFAULTBRANCH,
6060
Private: &GITHUB_REPO_PRIVATE,
6161
Owner: &github.User{
62-
Name: &GITHUB_OWNER_NAME,
62+
Login: &GITHUB_OWNER_LOGIN,
6363
},
6464
Name: &GITHUB_REPO_NAME,
6565
}
@@ -141,7 +141,7 @@ func TestGithubGetInfo(t *testing.T) {
141141
repoInfo, err := repo.GetInfo()
142142
require.NoError(t, err)
143143
require.Equal(t, GITHUB_DEFAULTBRANCH, repoInfo.DefaultBranch)
144-
require.Equal(t, GITHUB_OWNER_NAME, repoInfo.Owner)
144+
require.Equal(t, GITHUB_OWNER_LOGIN, repoInfo.Owner)
145145
require.Equal(t, GITHUB_REPO_NAME, repoInfo.Repo)
146146
require.True(t, repoInfo.Private)
147147
}

0 commit comments

Comments
 (0)