Octokit.Webhooks
2.0.4
Prefix Reserved
See the version list below for details.
dotnet add package Octokit.Webhooks --version 2.0.4
NuGet\Install-Package Octokit.Webhooks -Version 2.0.4
<PackageReference Include="Octokit.Webhooks" Version="2.0.4" />
paket add Octokit.Webhooks --version 2.0.4
#r "nuget: Octokit.Webhooks, 2.0.4"
// Install Octokit.Webhooks as a Cake Addin #addin nuget:?package=Octokit.Webhooks&version=2.0.4 // Install Octokit.Webhooks as a Cake Tool #tool nuget:?package=Octokit.Webhooks&version=2.0.4
Octokit.Webhooks
Libraries to handle GitHub Webhooks in .NET applications.
Usage
ASP.NET Core
dotnet add package Octokit.Webhooks.AspNetCore
Create a class that derives from
WebhookEventProcessor
and override any of the virtual methods to handle webhooks from GitHub. For example, to handle Pull Request webhooks:public sealed class MyWebhookEventProcessor : WebhookEventProcessor { protected override Task ProcessPullRequestWebhookAsync(WebhookHeaders headers, PullRequestEvent pullRequestEvent, PullRequestAction action) { ... } }
Register your implementation of
WebhookEventProcessor
:builder.Services.AddSingleton<WebhookEventProcessor, MyWebhookEventProcessor>();
Map the webhook endpoint:
app.UseEndpoints(endpoints => { ... endpoints.MapGitHubWebhooks(); ... });
MapGitHubWebhooks()
takes two optional parameters:
path
. Defaults to/api/github/webhooks
, the URL of the endpoint to use for GitHub.secret
. The secret you have configured in GitHub, if you have set this up.
Azure Functions
NOTE: Support is only provided for isolated process Azure Functions.
dotnet add package Octokit.Webhooks.AzureFunctions
Create a class that derives from
WebhookEventProcessor
and override any of the virtual methods to handle webhooks from GitHub. For example, to handle Pull Request webhooks:public sealed class MyWebhookEventProcessor : WebhookEventProcessor { protected override Task ProcessPullRequestWebhookAsync(WebhookHeaders headers, PullRequestEvent pullRequestEvent, PullRequestAction action) { ... } }
Register your implementation of
WebhookEventProcessor
:.ConfigureServices(collection => { ... collection.AddSingleton<WebhookEventProcessor, MyWebhookEventProcessor>(); ... })
Configure the webhook function:
new HostBuilder() ... .ConfigureGitHubWebhooks() ... .Build();
ConfigureGitHubWebhooks()
takes one optional parameter:
secret
. The secret you have configured in GitHub, if you have set this up.
The function is available on the /api/github/webhooks
endpoint.
Thanks
License
All packages in this repository are licensed under the MIT license.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Macross.Json.Extensions (>= 3.0.0)
- Microsoft.Extensions.Primitives (>= 7.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Octokit.Webhooks:
Package | Downloads |
---|---|
Octokit.Webhooks.AspNetCore
GitHub webhook events toolset for .NET |
|
Octokit.Webhooks.AzureFunctions
GitHub webhook events toolset for Azure Functions |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.3.0 | 169 | 10/2/2024 |
2.2.3 | 6,887 | 7/31/2024 |
2.2.2 | 5,220 | 6/27/2024 |
2.2.1 | 7,063 | 5/9/2024 |
2.2.0 | 692 | 5/6/2024 |
2.1.1 | 7,657 | 2/29/2024 |
2.1.0 | 5,952 | 12/19/2023 |
2.0.6 | 5,183 | 11/12/2023 |
2.0.5 | 1,878 | 10/26/2023 |
2.0.4 | 1,739 | 10/12/2023 |
2.0.3 | 7,094 | 8/25/2023 |
2.0.2 | 1,917 | 8/16/2023 |
2.0.1 | 4,166 | 6/13/2023 |
2.0.0 | 332 | 6/9/2023 |
1.5.2 | 3,066 | 6/1/2023 |
1.5.1 | 1,732 | 4/27/2023 |
1.5.0 | 390 | 4/25/2023 |
1.4.1 | 704 | 4/11/2023 |
1.4.0 | 211 | 4/6/2023 |
1.3.5 | 16,443 | 10/13/2022 |
1.3.4 | 303 | 10/5/2022 |
1.3.3 | 10,787 | 8/11/2022 |
1.3.2 | 220 | 8/9/2022 |
1.3.1 | 1,064 | 7/20/2022 |
1.3.0 | 169 | 7/19/2022 |
1.2.1 | 3,698 | 7/7/2022 |
1.2.0 | 173 | 7/7/2022 |
1.1.1 | 895 | 6/27/2022 |
1.1.0 | 391 | 6/13/2022 |
1.0.0 | 2,698 | 5/13/2022 |
0.6.5 | 856 | 4/27/2022 |
0.6.4 | 786 | 4/13/2022 |
0.6.3 | 2,223 | 3/31/2022 |
0.6.2 | 268 | 3/26/2022 |
0.6.1 | 197 | 3/25/2022 |
0.6.0 | 502 | 2/2/2022 |
0.5.0 | 764 | 1/24/2022 |
0.4.0 | 523 | 1/13/2022 |
0.3.0 | 5,931 | 11/23/2021 |
0.2.0 | 191 | 10/29/2021 |
0.1.2 | 256 | 9/27/2021 |
0.1.1 | 595 | 9/21/2021 |