diff --git a/providers/github/resources/discovery.go b/providers/github/resources/discovery.go index 9542ce552b..c433d114c5 100644 --- a/providers/github/resources/discovery.go +++ b/providers/github/resources/discovery.go @@ -95,7 +95,7 @@ func org(runtime *plugin.Runtime, orgName string, conn *connection.GithubConnect return nil, err } assetList = append(assetList, &inventory.Asset{ - PlatformIds: []string{connection.NewGithubOrgIdentifier(org.Name.Data)}, + PlatformIds: []string{connection.NewGithubOrgIdentifier(org.Login.Data)}, Name: org.Name.Data, Platform: connection.GithubOrgPlatform, Labels: map[string]string{}, @@ -108,8 +108,8 @@ func org(runtime *plugin.Runtime, orgName string, conn *connection.GithubConnect for i := range org.GetRepositories().Data { repo := org.GetRepositories().Data[i].(*mqlGithubRepository) assetList = append(assetList, &inventory.Asset{ - PlatformIds: []string{connection.NewGitHubRepoIdentifier(org.Name.Data, repo.Name.Data)}, - Name: org.Name.Data + "/" + repo.Name.Data, + PlatformIds: []string{connection.NewGitHubRepoIdentifier(org.Login.Data, repo.Name.Data)}, + Name: org.Login.Data + "/" + repo.Name.Data, Platform: connection.GithubRepoPlatform, Labels: make(map[string]string), Connections: []*inventory.Config{cloneInventoryConf(conn.Conf)}, diff --git a/providers/github/resources/github_org.go b/providers/github/resources/github_org.go index c4c6409fcd..dd710c279a 100644 --- a/providers/github/resources/github_org.go +++ b/providers/github/resources/github_org.go @@ -37,11 +37,13 @@ func initGithubOrganization(runtime *plugin.Runtime, args map[string]*llx.RawDat } var name string - if x, ok := args["name"]; ok { - name = x.Value.(string) + if org.Name != nil { + name = *org.Name } if name == "" { - name = *org.Name + if x, ok := args["name"]; ok { + name = x.Value.(string) + } } args["id"] = llx.IntDataPtr(org.ID) args["name"] = llx.StringData(name)