mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
fix(backend): Sourcebot not pulling github forked repos (#499)
This commit is contained in:
parent
c250c14fbe
commit
7020761ca6
2 changed files with 8 additions and 1 deletions
|
|
@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed sourcebot not pulling github forked repos [#499](https://github.com/sourcebot-dev/sourcebot/pull/499)
|
||||||
|
|
||||||
## [4.7.0] - 2025-09-17
|
## [4.7.0] - 2025-09-17
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -225,13 +225,17 @@ const getReposOwnedByUsers = async (users: string[], octokit: Octokit, signal: A
|
||||||
|
|
||||||
const { durationMs, data } = await measure(async () => {
|
const { durationMs, data } = await measure(async () => {
|
||||||
const fetchFn = async () => {
|
const fetchFn = async () => {
|
||||||
|
let query = `user:${user}`;
|
||||||
|
// To include forks in the search results, we will need to add fork:true
|
||||||
|
// see: https://docs.github.com/en/search-github/searching-on-github/searching-for-repositories
|
||||||
|
query += ' fork:true';
|
||||||
// @note: We need to use GitHub's search API here since it is the only way
|
// @note: We need to use GitHub's search API here since it is the only way
|
||||||
// to get all repositories (private and public) owned by a user that supports
|
// to get all repositories (private and public) owned by a user that supports
|
||||||
// the username as a parameter.
|
// the username as a parameter.
|
||||||
// @see: https://github.com/orgs/community/discussions/24382#discussioncomment-3243958
|
// @see: https://github.com/orgs/community/discussions/24382#discussioncomment-3243958
|
||||||
// @see: https://api.github.com/search/repositories?q=user:USERNAME
|
// @see: https://api.github.com/search/repositories?q=user:USERNAME
|
||||||
const searchResults = await octokit.paginate(octokit.rest.search.repos, {
|
const searchResults = await octokit.paginate(octokit.rest.search.repos, {
|
||||||
q: `user:${user}`,
|
q: query,
|
||||||
per_page: 100,
|
per_page: 100,
|
||||||
request: {
|
request: {
|
||||||
signal,
|
signal,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue