GitHub API/ Getting fork project for a specific user

is it possible to get a forked project for a specific user/login?

I have this method for getting forked project for a specific user github-action-build-chain/git.js at 0f6f5842608c8586998d226561d160e9b2b95e5d · kiegroup/github-action-build-chain · GitHub

The problem is the the API rate limit exceeded for installation ID XXXX exception is thrown sometimes since there are repositories with thousands of forked projects, and the method looks page by page (100 elements by page max) until the user is found. The question is: Is there a straight way to get the forked project for a specific user in a single query not having to browse through all the forked project elements.
Related issue: https://issues.redhat.com/browse/BXMSPROD-1361

Maybe a heuristic approach would help? Usually forks have the same repo name as the original so if B forks A/a then check if B/a exists and is a fork of A/a.

You can cheat:

  1. Pick your base repository
  2. Pick your potentially connected target user
  3. Pick two random commits which when compared have changed files in the base repository (you need too because if you’re unlucky, the base repository and fork will have no differences)

For example

  1. Base repository: actions/runner
  2. Network user: jsoref (me)
  3. Base commits: main, automate
  4. Ask github to compare the base repository for each of the two base commits against the HEAD of the networked user’s connected repository:

The result for one of them will tell you that my fork is called actions-runner. (The other says there are no changes, which is really unlucky. On average, especially for me, the HEAD will not be current.)

As for precisely how to do this from the API, that’s left as an exercise :wink:

thanks to both of you guys @jsoref @mattfbacon. @mattfbacon you gave me the idea and I finally create a PR to improve it [BXMSPROD-1361] getForkedProjectName improved by Ginxo · Pull Request #156 · kiegroup/github-action-build-chain · GitHub.
Anyway it would be nice to have a straight request to get forked project for a specific user.
Thanks!!