albertcai101 Posted August 27 Share Posted August 27 (edited) 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! Edited August 27 by albertcai101 Link to comment
FireFingers21 Posted August 27 Share Posted August 27 (edited) @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 August 27 by FireFingers21 vitor and albertcai101 2 Link to comment
vitor Posted August 27 Share Posted August 27 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. albertcai101 1 Link to comment
albertcai101 Posted August 27 Author Share Posted August 27 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
albertcai101 Posted Thursday at 05:25 PM Author Share Posted Thursday at 05:25 PM Here is the caching in action! It is very easy to search naturally. Link to comment
vitor Posted 13 hours ago Share Posted 13 hours ago @albertcai101 If you check the token settings, you’ll see now that GitHub has “Fine-grained tokens” in Beta and the other tokens are now called “Classic”. It might wise to update the instructions to the new token type (or include both). Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now