go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.88k stars 5.48k forks source link

Webhook payload documentation #9485

Closed JustAnotherArchivist closed 3 months ago

JustAnotherArchivist commented 4 years ago

I am currently working on a custom notification system involving Gitea. The details of this setup aren't really relevant to the topic at hand; there'll be an HTTP server that takes events via webhooks and produces notifications to send elsewhere.

My problem: there's hardly any documentation on webhooks. The doc page merely lists the different hooks available (Gitea, Gogs, and a few proprietary chat platforms) and gives one example of a payload for push events plus PHP code to securely accept a message. Here's a list of things I'm missing:

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

JustAnotherArchivist commented 4 years ago

Yes, this issue is still valid...

JustAnotherArchivist commented 4 years ago

Does any partial documentation on this exist in some obscure place I wasn't able to find, or would it have to be reconstructed from the commit history anyway? If so, it seems it shouldn't be very difficult to generate a documentation covering the first three points from the changes to modules/structs/hook.go. That file exists since commit 34eee25b (first released in 1.9.0), and it gets a bit messier before that due to a number of file moves/renames, but that should still be feasible; the structure of the file was the same ever since it was initially added in this repo in commit e378648c (before which it lived in the now obsolete and archived go-sdk repo, but that was all pre-1.0.0 and so probably doesn't really need to be documented). I could give that a shot.

techknowlogick commented 4 years ago

https://github.com/drone/go-scm/tree/master/scm/driver/gitea provides examples that I refer to when looking into working with receiving webhooks

lunny commented 3 months ago

Duplicate of #21478