Hub: Searching issue with hub

Created on 6 May 2020  路  4Comments  路  Source: github/hub

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:

feature

Most helpful comment

@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"

All 4 comments

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!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kurko picture kurko  路  4Comments

eromoe picture eromoe  路  4Comments

dsifford picture dsifford  路  4Comments

le0nik picture le0nik  路  4Comments

kentcdodds picture kentcdodds  路  4Comments