Skip to content

Commit b8e77cb

Browse files
Update event logging
Ping events are no longer logged. Unknown events are now logged as Debug. Signed-off-by: Gabriel Adrian Samfira <[email protected]>
1 parent ce7c67a commit b8e77cb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

apiserver/controllers/controllers.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ func (a *APIController) WebhookHandler(w http.ResponseWriter, r *http.Request) {
159159
switch event {
160160
case runnerParams.WorkflowJobEvent:
161161
a.handleWorkflowJobEvent(ctx, w, r)
162+
case runnerParams.PingEvent:
163+
// Ignore ping event. We may want to save the ping in the github entity table in the future.
162164
default:
163-
slog.InfoContext(ctx, "ignoring unknown event", "gh_event", util.SanitizeLogEntry(string(event)))
165+
slog.DebugContext(ctx, "ignoring unknown event", "gh_event", util.SanitizeLogEntry(string(event)))
164166
}
165167
}
166168

params/github.go

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const (
2222
// WorkflowJobEvent is the event set in the webhook payload from github
2323
// when a workflow_job hook is sent.
2424
WorkflowJobEvent Event = "workflow_job"
25+
PingEvent Event = "ping"
2526
)
2627

2728
// WorkflowJob holds the payload sent by github when a workload_job is sent.

0 commit comments

Comments
 (0)