Skip to content

Commit 46a483d

Browse files
committed
fix: fix graphql request for github repositories
1 parent ac208ec commit 46a483d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

discovery/describers/repository.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,12 @@ func GetRepository(
212212
"name": githubv4.String(repositoryName),
213213
}
214214

215+
appendRepoColumnIncludes(&variables, nil)
216+
215217
err = githubClient.GraphQLClient.Query(ctx, &query, variables)
218+
if err != nil {
219+
return nil, fmt.Errorf("error fetching repository rest details for %s/%s: %w", organizationName, repositoryName, err)
220+
}
216221
repoGraphqlDetail = query.Repository
217222
}
218223

discovery/describers/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ func appendRepoColumnIncludes(m *map[string]interface{}, cols []string) {
105105
"web_commit_signoff_required": "includeWebCommitSignoffRequired",
106106
"your_permission": "includeYourPermission",
107107
}
108-
for key, value := range optionals {
109-
(*m)[value] = githubv4.Boolean(slices.Contains(cols, key))
108+
for _, value := range optionals {
109+
(*m)[value] = githubv4.Boolean(true)
110110
}
111111
}
112112

0 commit comments

Comments
 (0)