GithubHelp home page GithubHelp logo

bswinnerton / launchbar-github Goto Github PK

View Code? Open in Web Editor NEW
70.0 7.0 7.0 3.65 MB

A LaunchBar action for GitHub

Home Page: http://launchbar-github.com

License: MIT License

JavaScript 97.45% Shell 2.55%
github launchbar launchbar-action

launchbar-github's Introduction

GitHub LaunchBar Action

This is a GitHub LaunchBar action that can search various parts of GitHub based on your input.

Download and install the action here.

Actions

At any point you can either hit enter to navigate into available options, or hit โŒ˜ + Enter to go directly to the corresponding GitHub page.

For a user or organization

Simply add a / to the end of a user or organization and the repositories will be fetched:

For a repository

For an issue or pull request

For a commit

At any time, paste a commit SHA into LaunchBar and hit Tab. Start typing "github" and you should see the action appear, hit Enter. Once complete, the action will bring you to the pull request that introduced the commit. If the commit is associated with multiple pull requests, they will be displayed in a list.

Shortening a link

At any time, paste a GitHub link into LaunchBar and hit Tab. Start typing "github" and you should see the action appear, hit Enter. Once complete, the action will ask you if you want to shorten the link, hit Enter and the shortened link will be copied to your clipboard.

Sending a link to Things

Similarly to shortening a link, you can paste a GitHub link into LaunchBar at any time and hit Tab. From there, either find GitHub in the options or type "github" to have it appear for the first time, then hit Enter to open the quick add menu of the Things application.

Installing

Automatic

The easiest way to install this action is by visiting http://launchbar-github.com/. You'll want to first Download and then Install the action.

When clicking on Install, you'll be prompted to sign in with GitHub. Once complete, you will be automatically brought back into the LaunchBar application and can start using the action.

Manual

If for any reason that doesn't work, the action can either be downloaded from the Releases page, or if you'd like to use the latest features as they come out (from master), you can clone this repository to your LaunchBar Actions folder:

mkdir -p ~/Library/Application\ Support/LaunchBar/Actions/
git clone https://github.com/bswinnerton/launchbar-github ~/Library/Application\ Support/LaunchBar/Actions/github.lbaction

GitHub Access Token

You'll need to get an access token from GitHub if you'd like to use any of the features that return data directly in LaunchBar. To do so, go to https://github.com/settings/tokens/new and create a new token with the repo user, read:discussion scopes selected. Copy the token to your clipboard and invoke the GitHub action and select "Settings". From here, choose "Set GitHub access token from clipboard".

Updating

This action can be updated using the Action Updates action, or you can drop into a terminal and pull the latest changes from Git using:

cd ~/Library/Application\ Support/LaunchBar/Actions/github.lbaction/
git pull origin master

In some cases, you may need to restart LaunchBar and regenerate a GitHub access token.

Development

This LaunchBar plugin is written in Javascript. Because I value both writing Javascript in ES6, and support for the action to run in older OS X environments, Babel is used to convert the files in Contents/Scripts/ into "vanilla Javascript" that can be parsed by most OS X JS engines.

If you're looking to contribute to this repository, you'll need to bootstrap the project by running:

script/bootstrap

This will install all dependencies for you. From there, you can run:

script/server

Which will listen for changes to any files in Contents/Scripts/ and automatically compile your Javascript into a single file that can be executed by LaunchBar.

If at any time you would like to run the tests, you can run:

script/test

Troubleshooting

I'm not seeing all of the repositories that I was expecting

If you set your token using http://launchbar-github.com and are not seeing repositories belonging to an organization you are a part of, the organization may have enabled Organization Application Policies. OAP limits access to private resources on GitHub unless the OAuth application has been granted access. You can either request access from an organization administrator, or instead use a Personal Access Token as outlined above to get around this problem.

launchbar-github's People

Contributors

bswinnerton avatar dependabot[bot] avatar jasonrudolph avatar tarebyte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

launchbar-github's Issues

Trim GitHub permissions?

This plugin looks really useful. Thanks for your work on it!

However, the GitHub permissions it asks for after clicking Install seemed a bit, well, permissive ๐Ÿ˜„. For example, it wants read/write for user profile data. Are all of the permissions the plugin asks for required, or can they be trimmed down a bit?

The manual instructions to get a token make it sound like the actual permissions it needs are less.

For now, I'll give it a go with the manual install.

Add test to ensure bundle.min.js was updated

When anyone submits a pull request, there should be a test that executes to ensure that the execution of script/build does not create a change in Contents/Scripts/bundle.min.js.

Add the ability to view org / repo projects

I'm often trying to find various GitHub Project boards and find them difficult to navigate to. It'd be great if on the organization / repo menus you could enumerate all of the projects and fuzzy search them.

Add analytics

Given that this tool was written in Javascript, it might be nice to add anonymized analytics to see which views are most popular to help drive the product forward.

Add the ability to clear the cache

Unfortunately there's no LaunchBar API to remove files, but one thing that we could do is iterate over the files that exist in the cache directory and zero them out.

Add exception tracker

Given that this tool was written in Javascript, it might be nice to add exception tracking to see where people are running into problems.

It looks like Sentry might have a Javascript offering.

Order of repositories could be improved

When typing out something like apple/swift, ideally that repository would show up first in the repository list. That is not the case right now:

screen shot 2017-10-29 at 3 06 05 pm

This causes problems for #88 since users will want to hit โŒ˜ + Enter to go directly to the repository in question rather than navigate down.

Add integration tests

It'd be great to test the GitHubLB class. This could act as the "integration test" to ensure that various different inputs expose the correct outputs.

We'll just want to stub out any calls to Action or LaunchBar.

Build an OAuth application to auto-set token

I'm not in love with the idea of having to generate a token by hand on https://github.com/settings/tokens/new and then set it with !set-token <token>. Instead (or perhaps, in addition to), it'd be nice if there was a website that offered a convenient way for users to download the action and set the token. This website could allow for users to sign in with GitHub using the OAuth Web Application Flow and generate a token on their behalf. Then, with this token, the website could craft a URL that looks something similar to:

x-launchbar:action/com.github.LaunchBar.action.GitHub/setToken?token=<token>

Which when clicked would invoke runWithURL(url, details) using the Action URL Script functionality in LaunchBar. From there, we could execute the regular setToken functionality.

Huge shout out to @marcomasser for the wonderful suggestion โœจ.

Add auto-updating support

In addition to #25, it would be nice if there was an option in settings to update this action to the latest version.

Start fuzzy searching for repositories after typing "<login>/"

I'm not sure if this is possible, but it'd be great if the action could start fuzzy searching for repositories right after the user types something like bswinnerton/ (which would require an API call).

I think this should be possible using the Suggestions Script functionality. We'd just want to make sure that it doesn't start executing until after a / is typed in order to avoid a collision with #22.

Add error handling to GraphQL calls

We'll want to return a special sort of message when:

  • The action is rate limited
  • The server responds with an application error
  • The server responds with an authentication error

Some users' repositories not showing

When I invoke the action, hit spacebar, and then type justinmimbs/, I don't get a list of the user's repositories. If I type justinmimbs and then select the View Repositories action, I only get the View All Repositories option.

Add caching

With at least a one hour TTL (to align with the GitHub rate limit).

Add issue / PR to Things

Things has support for URI schemes. It'd be really neat if you could paste in a GitHub URL and have LaunchBar fetch the title via an API call (using the GraphQL API's top-level resource field), and then add it to Things.

In other words, when a user enters a URL like the following into LaunchBar:

https://github.com/bswinnerton/launchbar-github/pull/91

...have it automatically convert it to something like:

Review bswinnerton/launchbar-github#91 "Use first class hide() function from LaunchBar"

With the full link back to that Issue / PR.

Commit search results in an error if commit doesn't belong to a pull request

Observed behavior

If you search for a commit that is not part of a pull request (e.g., 212d9cf4631cd175cc45e1930d141768a87b45f8), it results in the following error:

screen shot 2017-02-21 at 8 01 51 am

Expected behavior

If the commit isn't part of a PR, I was thinking that it would take you straight to the commit itself. For example, searching for 212d9cf4631cd175cc45e1930d141768a87b45f8 could take you to:
212d9cf

If that's not feasible, it would be nice to gracefully handle the error and inform the user that there is no pull request with the given commit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.