Skip to content
Snippets Groups Projects
Commit fb97d62c authored by Kevin Daudt's avatar Kevin Daudt :computer:
Browse files

fix(server): invert logic to detect events from bot

The logic to ignore events caused by the bot itself accidentally only
includes events comming from the bot.

Invert the logic, where it would process the event either when no user
is present, or the event was _not_ caused by the bot user.
parent 1df419ab
No related branches found
No related tags found
1 merge request!91fix(server): invert logic to detect events from bot
Pipeline #274145 passed
...@@ -114,8 +114,8 @@ func (l *WebhookEventListener) HookHandler(w http.ResponseWriter, req *http.Requ ...@@ -114,8 +114,8 @@ func (l *WebhookEventListener) HookHandler(w http.ResponseWriter, req *http.Requ
// Contrary to what the name implies this is actually an event related to a MERGE REQUEST // Contrary to what the name implies this is actually an event related to a MERGE REQUEST
// and not an event that is triggered when a merge request is merged // and not an event that is triggered when a merge request is merged
case *gitlab.MergeEvent: case *gitlab.MergeEvent:
if eventContent.User != nil && if eventContent.User == nil ||
eventContent.User.ID == l.config.BotUserID { eventContent.User.ID != l.config.BotUserID {
processMergeRequestEvent( processMergeRequestEvent(
eventContent, eventContent,
l.client, l.client,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment