Jump to content

My GitHub Search: Search ALL Your Repos (Personal, Starred, Organization)


Recommended Posts

Search all of your personal, starred, and organization repos using ghs and to open the repo's GitHub page in your default browser.

 

Visit GitHub at: https://github.com/albertcai101/alfred-my-github-search-workflow

Release page: https://github.com/albertcai101/alfred-my-github-search-workflow/releases/tag/auto

 

Please let me know what other functionality you would like to see included!

 

image.thumb.png.e28b8a50761d322cad1b52d33296d484.png

Edited by albertcai101
Link to comment
  • albertcai101 changed the title to My GitHub Search: Search ALL Your Repos (Personal, Starred, Organization)

@albertcai101 Welcome to the forum, and awesome workflow! Some suggestions:

  • You need to list jq as a dependency, as it’s not installed by default in macOS. Without it installed, it’s not immediately obvious why the workflow doesn’t work without reading through the code.
  • The current error checking for the GITHUB_USERNAME and GITHUB_TOKEN fields is unnecessary. Since these variables are set to "Required" in the Configuration Builder, the workflow won't run without them anyway. Checking the curl response instead to ensure the validity of the credentials could be handy though.
  • Consider changing the Keyword argument type to "Argument Optional". This will make the workflow immediately list all repositories without having to type a memorized name first.
  • Consider getting Alfred to filter results, setting the Match mode to either "Any order" or "Sequential". This would make searching much faster since you won't be rerunning the entire script and repeating the same API calls every time you type something new.
  • Lastly, generating XML is fine, but consider going all JSON. You're already using jq, so you can just use that to output to Alfred directly instead of going through the extra steps of converting it all to XML. See my linkding Bookmarks workflow as an example.

Looking forward to seeing the workflow evolve, it already has great utility!

Edited by FireFingers21
Link to comment

To add to @FireFingers21’s fantastic review:

  • Using the cache key (an exclusive to the JSON output, not available in the deprecated XML output) will make results even faster, by keeping the data for a while without needing a new request every time one invokes the workflow.
  • This is purely aesthetic, but it’s a strange (atypical) that the Placeholder Title ends with a period.

Link to comment
5 hours ago, vitor said:
  • Using the cache key (an exclusive to the JSON output, not available in the deprecated XML output) will make results even faster, by keeping the data for a while without needing a new request every time one invokes the workflow.
  • This is purely aesthetic, but it’s a strange (atypical) that the Placeholder Title ends with a period.

 

6 hours ago, FireFingers21 said:
  • You need to list jq as a dependency, as it’s not installed by default in macOS. Without it installed, it’s not immediately obvious why the workflow doesn’t work without reading through the code.
  • The current error checking for the GITHUB_USERNAME and GITHUB_TOKEN fields is unnecessary. Since these variables are set to "Required" in the Configuration Builder, the workflow won't run without them anyway. Checking the curl response instead to ensure the validity of the credentials could be handy though.
  • Consider changing the Keyword argument type to "Argument Optional". This will make the workflow immediately list all repositories without having to type a memorized name first.
  • Consider getting Alfred to filter results, setting the Match mode to either "Any order" or "Sequential". This would make searching much faster since you won't be rerunning the entire script and repeating the same API calls every time you type something new.
  • Lastly, generating XML is fine, but consider going all JSON. You're already using jq, so you can just use that to output to Alfred directly instead of going through the extra steps of converting it all to XML. See my linkding Bookmarks workflow as an example.

 

Thank you @FireFingers21 and @vitor for the great suggestions; I have implemented all of the following changes and released it! Find v1.0.1 at the Github :) 

You can also download the workflow directly, and read all of the new changes, in the releases page.

 

I am super happy because the searching is way faster. It does not send a new API call every time I retype and it can cache data for a customized time, from no cache to 1 whole day. When the data is cached, the results load instantly :))))

 

These were amazing suggestions, and I would love to hear more suggestions / feature requests!

 

Link to comment
  • 3 weeks later...

@vitor Thanks for the suggestion; I have been meaning to do this. My MacBook display unfortunately broke yesterday and I sent it out to repairs; and I am stuck using a Windows for now. I'll get to this when the repair is done.

 

If anyone wants to test and write up some documentation for fine-grained tokens with this plugin, that would be super helpful as well :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...