Octokit.Webhooks.AspNetCore
2.1.1
Prefix Reserved
dotnet add package Octokit.Webhooks.AspNetCore --version 2.1.1
NuGet\Install-Package Octokit.Webhooks.AspNetCore -Version 2.1.1
<PackageReference Include="Octokit.Webhooks.AspNetCore" Version="2.1.1" />
paket add Octokit.Webhooks.AspNetCore --version 2.1.1
#r "nuget: Octokit.Webhooks.AspNetCore, 2.1.1"
// Install Octokit.Webhooks.AspNetCore as a Cake Addin
#addin nuget:?package=Octokit.Webhooks.AspNetCore&version=2.1.1
// Install Octokit.Webhooks.AspNetCore as a Cake Tool
#tool nuget:?package=Octokit.Webhooks.AspNetCore&version=2.1.1
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
- Octokit.Webhooks (>= 2.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Octokit.Webhooks.AspNetCore:
Repository | Stars |
---|---|
microsoft/azure-openai-dev-skills-orchestrator
AI Agents Framework
|
Version | Downloads | Last updated |
---|---|---|
2.1.1 | 2,950 | 2/29/2024 |
2.1.0 | 4,346 | 12/19/2023 |
2.0.6 | 4,808 | 11/12/2023 |
2.0.5 | 1,977 | 10/26/2023 |
2.0.4 | 1,563 | 10/12/2023 |
2.0.3 | 5,369 | 8/25/2023 |
2.0.2 | 1,206 | 8/16/2023 |
2.0.1 | 2,348 | 6/13/2023 |
2.0.0 | 300 | 6/9/2023 |
1.5.2 | 3,205 | 6/1/2023 |
1.5.1 | 1,385 | 4/27/2023 |
1.5.0 | 356 | 4/25/2023 |
1.4.1 | 554 | 4/11/2023 |
1.4.0 | 199 | 4/6/2023 |
1.3.5 | 13,695 | 10/13/2022 |
1.3.4 | 300 | 10/5/2022 |
1.3.3 | 8,434 | 8/11/2022 |
1.3.2 | 188 | 8/9/2022 |
1.3.1 | 854 | 7/20/2022 |
1.3.0 | 149 | 7/19/2022 |
1.2.1 | 3,666 | 7/7/2022 |
1.2.0 | 173 | 7/7/2022 |
1.1.1 | 750 | 6/27/2022 |
1.1.0 | 333 | 6/13/2022 |
1.0.0 | 1,612 | 5/13/2022 |
0.6.5 | 517 | 4/27/2022 |
0.6.4 | 320 | 4/13/2022 |
0.6.3 | 2,137 | 3/31/2022 |
0.6.2 | 252 | 3/26/2022 |
0.6.1 | 185 | 3/25/2022 |
0.6.0 | 246 | 2/2/2022 |
0.5.0 | 715 | 1/24/2022 |
0.4.0 | 501 | 1/13/2022 |
0.3.0 | 5,971 | 11/23/2021 |
0.2.0 | 178 | 10/29/2021 |
0.1.2 | 250 | 9/27/2021 |
0.1.1 | 455 | 9/21/2021 |