Skip to content

Maybe fix webhook? #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions rubberduckvba.Server/Api/Admin/WebhookController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ public WebhookController(

[Authorize("webhook")]
[HttpPost("webhook/github")]
public async Task<IActionResult> GitHub()
public async Task<IActionResult> GitHub(dynamic body)
{
var reader = new StreamReader(Request.Body);
var json = await reader.ReadToEndAsync();
//var reader = new StreamReader(Request.Body);
//var json = await reader.ReadToEndAsync();
string json = body.ToString();

var payload = JsonSerializer.Deserialize<PushWebhookPayload>(json, new JsonSerializerOptions { PropertyNameCaseInsensitive = true })
?? throw new InvalidOperationException("Could not deserialize payload");
Expand Down
1 change: 1 addition & 0 deletions rubberduckvba.Server/Api/Tags/TagsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public TagsController(CacheService cache, IRubberduckDbService db, ILogger<TagsC
/// <summary>
/// Gets information about the latest release tags.
/// </summary>
[HttpGet("api/v1/public/tags")] // legacy route
[HttpGet("tags/latest")]
[AllowAnonymous]
public IActionResult Latest()
Expand Down