MHanafy.GithubClient 1.0.3

A .Net GitHub client that allows easy access to Github API, making developing Github apps a breaze.

Install-Package MHanafy.GithubClient -Version 1.0.3
dotnet add package MHanafy.GithubClient --version 1.0.3
<PackageReference Include="MHanafy.GithubClient" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MHanafy.GithubClient --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MHanafy.GithubClient, 1.0.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install MHanafy.GithubClient as a Cake Addin
#addin nuget:?package=MHanafy.GithubClient&version=1.0.3

// Install MHanafy.GithubClient as a Cake Tool
#tool nuget:?package=MHanafy.GithubClient&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

GithubClient

A .Net GitHub client that allows easy access to Github API, making developing Github apps a breaze.

To get started, you'll need to create a new Github App, this can be either private or public To create a new app, visit https://github.com/settings/apps

To use this library, you'll need:

  1. A private key, grab one by heading to your app's page, and selecting Generate a private key and download the key to your local machine
  2. The AppId, which you can get from the settings page

Now, start using the library as follows:

var serviceProvider = SetupDi();
//using DI to get the client, would use settings to get the required values from the config file.
var client = serviceProvider.GetService<IGithubClient>();

//listing all installations that the app has access to
var installations = await client.GetInstallations();

//Get an installation token to access the first installation; tokens are then renewed automatically before expiry
var token = await client.GetInstallationToken(installationId);

//Start interacting with the installation using the installation token
var checkSuites = await client.GetCheckSuites(token, repo, pull.Head.Sha)

This library provides models for various Github objects, but you can also issue raw requests if some models are missing

var url = $"https://api.github.com/app/installations";
var payload = $"";
var result = await client.Execute(System.Net.Http.HttpMethod.Get, url, token, payload);

For detailed example, update the sample app settings.json file with the App ID and the location of the private key file, and run it to see how easy it's to utilize github's new API from .Net.

GithubClient

A .Net GitHub client that allows easy access to Github API, making developing Github apps a breaze.

To get started, you'll need to create a new Github App, this can be either private or public To create a new app, visit https://github.com/settings/apps

To use this library, you'll need:

  1. A private key, grab one by heading to your app's page, and selecting Generate a private key and download the key to your local machine
  2. The AppId, which you can get from the settings page

Now, start using the library as follows:

var serviceProvider = SetupDi();
//using DI to get the client, would use settings to get the required values from the config file.
var client = serviceProvider.GetService<IGithubClient>();

//listing all installations that the app has access to
var installations = await client.GetInstallations();

//Get an installation token to access the first installation; tokens are then renewed automatically before expiry
var token = await client.GetInstallationToken(installationId);

//Start interacting with the installation using the installation token
var checkSuites = await client.GetCheckSuites(token, repo, pull.Head.Sha)

This library provides models for various Github objects, but you can also issue raw requests if some models are missing

var url = $"https://api.github.com/app/installations";
var payload = $"";
var result = await client.Execute(System.Net.Http.HttpMethod.Get, url, token, payload);

For detailed example, update the sample app settings.json file with the App ID and the location of the private key file, and run it to see how easy it's to utilize github's new API from .Net.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.3 150 11/26/2020
1.0.2 265 3/4/2020
1.0.1 204 3/3/2020
1.0.0 254 2/23/2020