2022-07-24 19:39:37 +00:00
|
|
|
```meta
|
|
|
|
type: plug
|
|
|
|
uri: github:silverbulletmd/silverbullet-github/github.plug.json
|
|
|
|
repo: https://github.com/silverbulletmd/silverbullet-github
|
|
|
|
author: Zef Hemel
|
|
|
|
```
|
2022-10-12 09:47:13 +00:00
|
|
|
|
2022-08-09 13:37:47 +00:00
|
|
|
<!-- #include [[https://raw.githubusercontent.com/silverbulletmd/silverbullet-github/main/README.md]] -->
|
2022-10-12 09:47:13 +00:00
|
|
|
|
2022-07-25 14:51:46 +00:00
|
|
|
# SilverBullet plug for Github
|
2022-10-12 09:47:13 +00:00
|
|
|
|
|
|
|
Provides Github events, notifications and pull requests as query sources using
|
|
|
|
SB's query mechanism
|
2022-07-24 19:39:37 +00:00
|
|
|
|
2022-07-25 14:51:46 +00:00
|
|
|
## Installation
|
2022-10-12 09:47:13 +00:00
|
|
|
|
2022-07-25 14:51:46 +00:00
|
|
|
Open your `PLUGS` note in SilverBullet and add this plug to the list:
|
|
|
|
|
|
|
|
```
|
|
|
|
- github:silverbulletmd/silverbullet-github/github.plug.json
|
|
|
|
```
|
|
|
|
|
|
|
|
Then run the `Plugs: Update` command and off you go!
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2022-10-12 09:47:13 +00:00
|
|
|
This step is optional for anything but the `gh-notification` source, but without
|
|
|
|
it you may be rate limited by the Github API,
|
|
|
|
|
|
|
|
To configure, add a `githubToken` key to your `SECRETS` page, this should be a
|
|
|
|
[personal access token](https://github.com/settings/tokens):
|
2022-07-25 14:51:46 +00:00
|
|
|
|
2022-10-12 09:47:13 +00:00
|
|
|
```yaml
|
|
|
|
githubToken: your-github-token
|
|
|
|
```
|
2022-07-25 14:51:46 +00:00
|
|
|
|
|
|
|
## Query sources
|
|
|
|
|
2022-10-12 09:47:13 +00:00
|
|
|
- `gh-event` required filters in the `where` clause:
|
|
|
|
- `username`: the user whose events to query
|
|
|
|
- `gh-pull`
|
|
|
|
- `repo`: the repo to query PRs for
|
|
|
|
- `gh-notification` requires a `githubToken` to be configured in `SECRETS`.
|
2022-07-24 19:39:37 +00:00
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
Example uses:
|
|
|
|
|
|
|
|
## Recent pushes
|
|
|
|
<!-- #query gh-event where username = "zefhemel" and type = "PushEvent" select type, actor_login, created_at, payload_ref limit 3 -->
|
|
|
|
|
|
|
|
<!-- /query -->
|
|
|
|
|
|
|
|
## Recent PRs
|
2022-08-09 13:37:47 +00:00
|
|
|
<!-- #query gh-pull where repo = "silverbulletmd/silverbullet" and user_login = "zefhemel" limit 3 render [[template/gh-pull]] -->
|
2022-07-24 19:39:37 +00:00
|
|
|
|
|
|
|
<!-- /query -->
|
|
|
|
|
|
|
|
Where the `template/gh-pull` looks as follows:
|
|
|
|
|
2022-07-25 14:51:46 +00:00
|
|
|
* ({{state}}) [{{title}}]({{html_url}})
|
2022-10-12 09:47:13 +00:00
|
|
|
|
2022-07-25 14:51:46 +00:00
|
|
|
<!-- /include -->
|