Please refer to the documentation for the most recent information
This is a plug in for StreamDeck that will monitor the count of issues or pull request of a given GitHub repository.
The plug in will check the repository and show the count of either issues or pull requests that meet the filter criteria.
See the features below for more details.
This was done using BarRaider's Stream Deck Tools.
https://github.com/{repo-owner}/{repo-name}
30
.1
30
1
All of these are optional filters that can be stacked.
Initial Offset. When first launching the plug in, it will retrieve a certain amount of information from the repository. The offset specifies how far back it will retrieve information the first time, expressed in days. Default is 2
.
Issue Assignee. Will return the amount of issues with a given assignee
Issue Creator. Will return the amount of issues that were created by a given user
Mentioned User. Will return the amount of issues where a given user was mentioned
Milestone. Will return the amount of issues associated with a given milestone
Issue Creator. Will return the amount of issues that were created by a given user
Filter By. Will return the amount of issues according to the selected option:
State. Will return the amount of issues according to the selected state:
All of these are optional filters that can be stacked.
The GitHub API is more limited regarding on the filters that can be applied to the pull requests request, so if you wish to fine tune the counting of pull requests, you will have to use the custom filters.
The API returns anything that has been update within the specified time frame.
For example, if the plug in is configured to return the amount of issues with the state open with the initial offset time frame of 2 days, it will return all the open issues that has been updated within the last two days. It will not return the issues that were open in the last two day.
An issue/pull requests is considered updated if it has been:
If you want to have a better control on what is being returned and counted, use custom filtering.
A caveat of the GitHub API, the GetIssues
method not only return issues but may also return pull requests as well.
According to the GitHub documentation:
GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the
pull_request
key. Be aware that theid
of a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.
However, with this in mind, the implementation of the API for this plug in returns all the issues without an associated pull request.
Since the GitHub API is quite limited on regards the filters that can be applied to the requests, specially for the pull request, I added the possibility to apply custom filters using Roslyn scripting to the result of the call.
These filters are basically lambdas expressions that are applied to the result of the GitHub request sequentially. This, of course, requires a basic knowledge of the models used by the Octokit.net library.
Since Roslyn executes the scripts inside a sandbox, it requires to also specify the imports directives. The most commons are Octokit
, System
, and System.Linq
, and others depending your need.
The first line of the Custom Filter text area is reserved for the import directives, they have to be comma-separated
The lambdas can be declared starting the second line
All the lines have to end with ;
If you wanted to count only the pull requests or issues that were open within the last 2 days, you can use:
Octokit,System,System.Linq,System.Collections.Generic;
x => x.CreatedAt > DateTime.Now.Subtract(new TimeSpan(2, 0, 0, 0));
If you wanted to count only the pull requests or issues that have the label Team: SuperTeam
, you can use:
Octokit,System,System.Linq,System.Collections.Generic;
x => x.Labels.Any(x => new string[] { \"Team: SuperTeam\" }.Contains(x.Name));
If you wanted to count only the pull requests that are merged and updated within the last hour, you can use:
Octokit,System,System.Linq,System.Collections.Generic;
x => x.Merged == true;
x => x.UpdatedAt > DateTime.Now.Subtract(new TimeSpan(1, 0, 0));
The icons are modified version of Repository iOS Glyph and Repository Fluent at Icon8.