Skip to content

Instantly share code, notes, and snippets.

@waldyrious
Last active February 29, 2020 11:58
Show Gist options
  • Save waldyrious/f564bc9e6b5f83c34f49cb92f7b89b53 to your computer and use it in GitHub Desktop.
Save waldyrious/f564bc9e6b5f83c34f49cb92f7b89b53 to your computer and use it in GitHub Desktop.
Github GraphQL search repos by license
# ISC-licensed repositories with more than 1000 stars
{
search(query: "license:isc stars:>1000", type: REPOSITORY, first: 100) {
repositoryCount
edges {
node {
... on Repository {
nameWithOwner
url
primaryLanguage { name }
stargazers { totalCount }
}
}
}
}
}
# WIP: Same as above, but including the detected license name
# and the license text (to automatically detect whether it has the title)
# TODO: get the license file dynamically or search multiple paths.
{
search(query: "license:isc stars:>1000", type: REPOSITORY, first: 10) {
repositoryCount
edges {
node {
... on Repository {
nameWithOwner
stargazers { totalCount }
primaryLanguage { name }
licenseInfo { name }
object(expression: "HEAD:LICENSE") {
... on Blob {
#text
abbreviatedOid
}
}
}
}
}
}
}
@waldyrious
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment