Skip to content

Commit 718571b

Browse files
fix(backend): Sourcebot not pulling github forked repos
1 parent ccd0706 commit 718571b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/backend/src/github.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,17 @@ const getReposOwnedByUsers = async (users: string[], octokit: Octokit, signal: A
225225

226226
const { durationMs, data } = await measure(async () => {
227227
const fetchFn = async () => {
228+
let query = `user:${user}`;
229+
// To include forks in the search results, we will need to add fork:true
230+
// see: https://docs.github.com/en/search-github/searching-on-github/searching-for-repositories
231+
query += ' fork:true';
228232
// @note: We need to use GitHub's search API here since it is the only way
229233
// to get all repositories (private and public) owned by a user that supports
230234
// the username as a parameter.
231235
// @see: https://github.com/orgs/community/discussions/24382#discussioncomment-3243958
232236
// @see: https://api.github.com/search/repositories?q=user:USERNAME
233237
const searchResults = await octokit.paginate(octokit.rest.search.repos, {
234-
q: `user:${user}`,
238+
q: query,
235239
per_page: 100,
236240
request: {
237241
signal,

0 commit comments

Comments
 (0)