4 releases (2 stable)
1.1.0 | Nov 5, 2022 |
---|---|
1.0.0 | Feb 6, 2022 |
0.6.0 | Jan 6, 2022 |
0.5.0 | Jan 2, 2022 |
#16 in #pr
18KB
332 lines
Goodbrother
List open PRs in Github by user. Rust port of original TypeScript library.
Motivation
If you have many repos that receive regular updades with Dependabot, you're simply likely to miss some of them. I occasionally only found PRs when I get notification that they were closed in favor of a even newer version.
Goodbrother is there to let me know if I still have some open.
Install
cargo add goodbrother
Or add this to your Cargo.toml
:
[dependencies]
goodbrother = "1.1.0"
Usage
Listing all pull requests:
use goodbrother::{get_pull_requests_by_user, PullRequest};
// Fetch list of open PRs by user.
let username = "stscoundrel";
// Returns Result, which may be error due to Github API connections.
let result = get_pull_requests_by_user(username).unwrap();
// Result is a vector of PullRequest structs. Eg:
// {
// id: 1068208284,
// name: Bump eslint-config-airbnb-base from 14.2.1 to 15.0.0,
// link: https://github.com/stscoundrel/gatsby-source-plugin-zoega/pull/18,
// is_dependabot: true,
// repository: stscoundrel/gatsby-source-plugin-zoega,
// }
Listing pull requests grouped by repos:
use goodbrother::{get_grouped_pull_requests_by_user, Repository};
// Fetch list of open PRs by user.
let username = "stscoundrel";
// Returns Result, which may be error due to Github API connections.
let result = get_grouped_pull_requests_by_user(username).unwrap();
// Result is a vector of Repository structs. Eg:
// {
// name: goodbrother
// pull_requests: PullRequest[],
// }
Dependencies
~4–16MB
~216K SLoC