Merge pull request #348 from gabriel-samfira/change-event-log

Update event logging
This commit is contained in:
Gabriel 2025-02-10 15:21:35 +02:00 committed by GitHub
commit aa60ae9c09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -159,8 +159,10 @@ func (a *APIController) WebhookHandler(w http.ResponseWriter, r *http.Request) {
switch event {
case runnerParams.WorkflowJobEvent:
a.handleWorkflowJobEvent(ctx, w, r)
case runnerParams.PingEvent:
// Ignore ping event. We may want to save the ping in the github entity table in the future.
default:
slog.InfoContext(ctx, "ignoring unknown event", "gh_event", util.SanitizeLogEntry(string(event)))
slog.DebugContext(ctx, "ignoring unknown event", "gh_event", util.SanitizeLogEntry(string(event)))
}
}

View file

@ -22,6 +22,7 @@ const (
// WorkflowJobEvent is the event set in the webhook payload from github
// when a workflow_job hook is sent.
WorkflowJobEvent Event = "workflow_job"
PingEvent Event = "ping"
)
// WorkflowJob holds the payload sent by github when a workload_job is sent.