The problem I'm trying to solve:
I'm trying to use search API using hub but it keeps failing...
If I want to use this,
curl https://api.github.com/search/issues?q=repo:< repo >+< search text >
as hub command, is it the right way to use it like this?
hub api search/issue -F '< search text >'
I tried several other GET
APIs but it doesn't work.
Is there any way that I could use search/issue
? If so, is it possible to use on enterprise github?
How I imagine hub could expose this functionality:
I got it to work by adding -X GET
and changing the value for the -F
flag to q=<search query>
. Altogether it looks like this:
hub api -X GET search/issues -F q="<search query>"
example:
hub api -X GET search/issues -F q="searching issue with hub"
Hi @srafi1 I been using your solution very well, thank you so much!!
However, I still can't figure out how to select specific repository using this query.
if I try
hub api -X GET search/issues -F q="repo:< repo >+<search query>"
I get an error... is there any other way that I can perform this?
@JacobJae I think the search query should go before the repo like this:
hub api -X GET search/issues -F q="<search query>+repo:<repo>"
ex:
hub api -X GET search/issues -F q="searching issues+repo:github/hub"
Thank you, I tried repo in front of issue :(
Now it works!!! thanks!!!
Most helpful comment
@JacobJae I think the search query should go before the repo like this:
ex: