Add tests for webhook and fix some webhook bugs (#33396) (#33442)

This PR created a mock webhook server in the tests and added integration
tests for generic webhooks.
It also fixes bugs in package webhooks and pull request comment
webhooks.

This also corrected an error on the package webhook. The previous
implementation uses a `User` struct as an organization, now it has been
corrected but it will not be consistent with the previous
implementation, some fields which not belong to the organization have
been removed.

Backport #33396
Backport part of #33337
This commit is contained in:
Lunny Xiao 2025-02-01 22:44:50 -08:00 committed by GitHub
parent ebac324ff2
commit 23971a77a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 682 additions and 105 deletions

View file

@ -26,6 +26,7 @@ type HookEvents struct {
Repository bool `json:"repository"`
Release bool `json:"release"`
Package bool `json:"package"`
Status bool `json:"status"`
}
// HookEvent represents events that will delivery hook.