add: webhook

This commit is contained in:
h z
2025-03-10 09:39:59 +00:00
parent 22e415bce8
commit ec7ef39128
6 changed files with 122 additions and 33 deletions

View File

@@ -0,0 +1,39 @@
namespace Alchegos.Gitea.Webhook.Models;
using System.Text.Json.Serialization;
public class GiteaWebhookPayload
{
[JsonPropertyName("repository")]
public Repository? Repository { get; set; }
[JsonPropertyName("pusher")]
public User? Pusher { get; set; }
[JsonPropertyName("commits")]
public List<CommitInfo>? Commits { get; set; }
[JsonPropertyName("head_commit")]
public CommitInfo? HeadCommit { get; set; }
}
public class Repository
{
[JsonPropertyName("name")]
public string? Name { get; set; }
}
public class User
{
[JsonPropertyName("username")]
public string? UserName { get; set; }
}
public class CommitInfo
{
[JsonPropertyName("id")]
public string? Id { get; set; }
[JsonPropertyName("message")]
public string? Message { get; set; }
}