Last active
February 29, 2020 11:58
-
-
Save waldyrious/f564bc9e6b5f83c34f49cb92f7b89b53 to your computer and use it in GitHub Desktop.
Github GraphQL search repos by license
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try it on https://developer.github.com/v4/explorer/