Show data from GitHub's API.
- Generate a GitHub personal access token (you can allow only the scopes required for your query)
- Put the token under "GitHub Access Token" in the settings
- Select one of the presets and modify the settings to your liking
Log into your GitHub account and generate an access token with the proper permissions.
The GraphQL query that will be sent to GitHub's API. The query will be refetched in the background every 60 seconds and after every settings change.
Useful links:
Optionally show a counter in the bottom-right corner. Used for 1-2 digit numbers, won't work well with texts.
Value path
is the path to the value in the query response (Uses Lodash's get() syntax). The value will always be cast to a string.Show condition
is a JavaScript expression which should resolve to a boolean. For example, the condition!== "0"
will not show the badge if the value is"0"
. This is basically what happens under the hood:
eval(`${badgeValue} ${badgeCondition};`)
Control the color of the icon depending on the query response.
Value path
- same as the badge value pathColors dictionary
is a JSON dictionary. The special values aredefault
anderror
, and the rest are the status values:
{
"default": "#aa9900",
"error": "#ff3333",
"0": "#66ff66",
"any-other-value-that-can-be-returned": "#666666"
}
What should happen after pressing the Stream Deck button:
Re-fetch data
will send the query immediatellyOpen First URL
will find the first URL value in the response and open it in your browserOpen All URLs
will open all URL values in the response in your browser
Shows the number of pull requests you were requested to review. If you have at least 1 PR, the background will be yellow. Pressing the button will open the first 5 PRs.
Shows the number of open pull requests you're the author of. If you have at least 1 failing PR, the background will be yellow. Pressing the button will open the first 5 PRs.
Shows the status of the last commit on the default branch of a repository (edit the repo owner/name fields in the query). The background will be red on error/failure, yellow on pending, and green on success/expected. Pressing the button will open the first associated PR of the commit.
- Create a symlink from the
dist/
directory to the plugins directory:
ln -s $(pwd)/dist ~/Library/Application\ Support/com.elgato.StreamDeck/Plugins/com.github.guyb7.github-api-streamdeck-plugin.sdPlugin
- Build the plugin:
npm run build
- Reload the Stream Deck application, and then the app will be available under "Custom > GitHub API"
To debug:
- Run
defaults write com.elgato.StreamDeck html_remote_debugging_enabled -bool YES
- Reload the Stream Deck application
- Open http://localhost:23654/
- Bump version
cd ~/Library/Application Support/com.elgato.StreamDeck/Plugins
./DistributionTool -b -i com.github.guyb7.github-api-streamdeck-plugin.sdPlugin -o ~/Desktop
- Email
[email protected]
with release notes