Skip to content

Commit 7020761

Browse files
fix(backend): Sourcebot not pulling github forked repos (#499)
1 parent c250c14 commit 7020761

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
- Fixed sourcebot not pulling github forked repos [#499](https://github.com/sourcebot-dev/sourcebot/pull/499)
12+
1013
## [4.7.0] - 2025-09-17
1114

1215
### Added

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)