Add EndpointType

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-05-12 17:32:37 +00:00
parent ef676488b7
commit 4890eb4732
6 changed files with 48 additions and 11 deletions

View file

@ -103,6 +103,7 @@ func (a *APIController) handleWorkflowJobEvent(ctx context.Context, w http.Respo
handleError(ctx, w, gErrors.NewBadRequestError("invalid post body: %s", err))
return
}
slog.Debug("received workflow job event", "body", string(body))
signature := r.Header.Get("X-Hub-Signature-256")
hookType := r.Header.Get("X-Github-Hook-Installation-Target-Type")
@ -154,6 +155,9 @@ func (a *APIController) WebhookHandler(w http.ResponseWriter, r *http.Request) {
}
headers := r.Header.Clone()
for k, v := range headers {
slog.Debug("header", "key", k, "value", v)
}
event := runnerParams.Event(headers.Get("X-Github-Event"))
switch event {