Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we have search option in octokit.repos.listForAuthenticatedUser() #185

Open
rohitcoder opened this issue Aug 11, 2022 · 1 comment
Open
Labels
Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects

Comments

@rohitcoder
Copy link

What’s missing?
I don't see a Search option in octokit.repos.listForAuthenticatedUser(), and i think this is same for the underlying REST API by Github, Can someone recommend me any good alternative to search all repositories from my organization and personal profile?

I was thinking to load all repos, index them in local DB and then run a search on that, but this kind of feature is already available in bitbucket and gitlab, we don't need to index repos for them.

I'm using below code for listing all repos

const repos = await octokit.repos.listForAuthenticatedUser({
  visibility: 'all',
  affiliation: 'owner,collaborator,organization_member',
  per_page: args.limit,
  page: args.page,
  sort: 'updated',
})

In bitbucket and Giltab we've q and query within listing Repositories. Can we've something like that?

Why?
Let's suppose I've 3,000 Repos and I want to search for any specific one, how I'll do that? (affiliation could be owner,collaborator,organization_member)

Alternatives you tried
I've the last option to index them in DB and then search on top of it, but there will be another issue, an organization can delete some repo, and create new repos, and adding/removeing these many repos in DB every time will not be a good approach.

@rohitcoder rohitcoder added the Type: Feature New feature or request label Aug 11, 2022
@ghost ghost added this to Features in JS Aug 11, 2022
@timrogers
Copy link

Hi @rohitcoder! 👋🏻 Depending on your search criteria, the "Search repositories" API (https://docs.github.com/en/rest/search#search-repositories) might work for you. Can you give that a go?

@gr2m gr2m added Type: Support Any questions, information, or general needs around the SDK or GitHub APIs and removed Type: Feature New feature or request labels Aug 11, 2022
@ghost ghost moved this from Features to Support in JS Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects
No open projects
JS
  
Support
Development

No branches or pull requests

3 participants