KO
|
EN
gitlite — search
Search
#python
#javascript
#css
#ai
#html
#webdevelopment
#typescript
#automation
#golang
#nextjs
#tailwindcss
#deep-learning
webhooks.net
★ 68
Open GitHub ↗
GitHub webhook events toolset for .NET
Download README (.md)
Explore Similar Repositories
linear-discord-serverless
:
Get linear's events forwarded to Discord webhooks through Vercel serverless functions.
PgHook
:
PgHook listens to PostgreSQL logical replication events and posts changed row information as JSON to webhooks.
laravel-mandrillhooks
:
A simple Mandrill webhook base controller for catching bounced, rejected, etc mail events.
jthoober
:
run bash scripts when you get a push event from a github webhook
gello
:
## Auto-archived due to inactivity. ## :octocat: A self-hosted server for managing Trello cards based on GitHub webhook events
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
webhooks.net
?
Download (.md)
# Octokit.Webhooks [](https://github.com/octokit/webhooks.net/actions/workflows/build.yml?query=branch%3Amain) [](https://www.nuget.org/packages/Octokit.Webhooks/) [](https://www.nuget.org/packages/Octokit.Webhooks/) [](https://scorecard.dev/viewer/?uri=github.com/octokit/webhooks.net) Libraries to handle GitHub Webhooks in .NET applications. ## Usage ### ASP.NET Core 1. `dotnet add package Octokit.Webhooks.AspNetCore` 2. 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: ```C# public sealed class MyWebhookEventProcessor : WebhookEventProcessor { protected override ValueTask ProcessPullRequestWebhookAsync( WebhookHeaders headers, PullRequestEvent pullRequestEvent, PullRequestAction action, CancellationToken cancellationToken = default) { ... } } ``` 3. Register your implementation of `WebhookEventProcessor`: ```C# builder.Services.AddSingleton<WebhookEventProcessor, MyWebhookEventProcessor>(); ``` 4. Map the webhook endpoint: ```C# 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](https://learn.microsoft.com/azure/azure-functions/dotnet-isolated-process-guide). 1. `dotnet add package Octokit.Webhooks.AzureFunctions` 2. 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: ```C# public sealed class MyWebhookEventProcessor : WebhookEventProcessor { protected override ValueTask ProcessPullRequestWebhookAsync( WebhookHeaders headers, PullRequestEvent pullRequestEvent, PullRequestAction action, CancellationToken cancellationToken = default) { ... } } ``` 3. Register your implementation of `WebhookEventProcessor` and configure the webhook function: ```C# var builder = FunctionsApplication.CreateBuilder(args); builder.Services.AddSingleton<WebhookEventProcessor, MyWebhookEventProcessor>(); builder.ConfigureGitHubWebhooks(); builder.Build().Run(); ``` `ConfigureGitHubWebhooks` has two overloads: * `ConfigureGitHubWebhooks(string? secret = null)`. Pass the secret you have configured in GitHub, if you have set this up. * `ConfigureGitHubWebhooks(Func<IConfiguration, string> configure)`. Resolve the secret from configuration at runtime. The function is available on the `/api/github/webhooks` endpoint. ## Thanks - [octokit/webhooks](https://github.com/octokit/webhooks) - [terrajobst/Terrajobst.GitHubEvents](https://github.com/terrajobst/Terrajobst.GitHubEvents) - [Dotnet-Boxed/Templates](https://github.com/Dotnet-Boxed/Templates) ## License All packages in this repository are licensed under [the MIT license](https://opensource.org/licenses/MIT).