I need to assemble script, which will get names of repositories, starting from "test*", within particular organization, on Github.
Can anyone hint me - in which way to dig? Either this possible via some API queries, or I can do this via git command line?
You can use a search query to filter the repository by keyword test
located in repo name, description or README (but there is no filter for the repo name only) :
https://api.github.com/search/repositories?q=org%3Agithub%20test&per_page=100
{
search(query: "test org:github", type: REPOSITORY, first: 100) {
repositoryCount
edges {
node {
... on Repository {
nameWithOwner
}
}
}
}
}
Try it in the explorer
Assembling all answers above I found, that to find all repos (including private) with some search criteria, within organization, I need to use following query:
https://api.github.com/search/repositories?q=org:MY_ORG:MY_SEARCHCRITERIA&page=1&per_page=100&access_token=MY_ACCESSTOKEN
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With