Expand description

Retrieve releases versions of a repository from GitHub.

Two functions are exposed by this crate: one to get the latest (Semantic Versioned) version, and another to get all of the release versions (as Strings).

This crate works for public and private GitHub repositories on public GitHub or GitHub enterprise when supplied with a valid access token for that repository / environment.

The simplest use case is a public repository on github.com:

use github_release_check::GitHub;

let github = GitHub::new().unwrap();
let versions = github.get_all_versions("celeo/github_release_check").unwrap();

If you want to access a private repository on github.com, you’ll need an access token for a user who can view that repository:

use github_release_check::{GitHub, DEFAULT_API_ROOT};

let github = GitHub::from_custom(DEFAULT_API_ROOT, "your-access-token").unwrap();
let versions = github.get_all_versions("you/private-repo").unwrap();

If you are using a private GitHub enterprise environment:

use github_release_check::GitHub;

let github = GitHub::from_custom("https://github.your_domain.com/api/v3/", "your-access-token").unwrap();
let versions = github.get_all_versions("you/private-repo").unwrap();

Of course, handling these Results with something other than just unwrapping them is a good idea.

If you wish to gain more information on each release, use the query function:

use github_release_check::GitHub;

let github = GitHub::new().unwrap();
let versions = github.query("celeo/github_release_check").unwrap();

Structs

Struct to communicate with the GitHub REST API.
Data for a release in the GitHub API response.

Enums

Errors that may be raised by this crate.

Constants

The default GitHub instance API root endpoint.