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

merge: 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.

See merge request !91
parents 1df419ab fb97d62c
No related branches found
No related tags found
1 merge request!91fix(server): invert logic to detect events from bot
Pipeline #274146 passed
......@@ -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
// and not an event that is triggered when a merge request is merged
case *gitlab.MergeEvent:
if eventContent.User != nil &&
eventContent.User.ID == l.config.BotUserID {
if eventContent.User == nil ||
eventContent.User.ID != l.config.BotUserID {
processMergeRequestEvent(
eventContent,
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