Hello! Has there been any consideration to add a way to filter repos for the GitHub source plugin? Possibly a search
parameter that would be an alternative to the org
and repos
parameters that are currently available. Otherwise, is this a feature that would be accepted if contributed?
Hi @poppy-bloom
This sounds useful! I can’t speak for everyone, but I think we would accept such a feature. What would you like to use it for?
We try to be a relatively thin wrapper to the underlying APIs, so it would be best if the functionality closely maps to an underlying GitHub API call (maybe /search/repositories
?). I think a new config option like search_repos
that takes multiple search queries could work here.
My thinking is that when this option is specified, the plugin would first run these searches, combining all the repos matched into a single list, then apply any organization/repo filters (if specified). In this way, you can think of the current behavior as being a search for *
which is then filtered down by repo & org settings.
That implementation looks reasonable to me. It would fit my use case.
I’d like to use this feature to narrow down the repos in my org based on topic. We have ~2000+ repos and attempting to scan them all results in rate limiting issues. Specifying a list of repos works, but it’s not ideal because it requires maintenance or additional automation complexity that I’d like to avoid.
Being able to use a search query would let me search for something like org:myorg topic:sometopic
or to exclude repos that we don’t care to scan like org:myorg -topic:homework
. That way when new repos are created they’ll be included in scans once they’ve been tagged and no update is needed to the CQ config.