fix: don't filter actor for review_requested to allow CI self-request (fixes PR 185)

This commit is contained in:
2026-09-03 13:15:17 +00:00
parent ce845a7baf
commit 409711cd7b
+14 -10
View File
@@ -175,14 +175,18 @@ func (p *Processor) HandlePullRequest(e *webhook.PullRequestEvent) {
}
}
// Remove the actor from notifications (don't notify yourself)
beforeFilter := len(usersToNotify)
usersToNotify = p.filterOutActor(usersToNotify, event.Actor)
p.logger.Debug().
Int("before_filter", beforeFilter).
Int("after_filter", len(usersToNotify)).
Str("actor_filtered", event.Actor.GiteaUsername).
Msg("filtered out actor from notifications")
// Remove the actor from notifications (don't notify yourself) - but SKIP for review_requested because CI automation may request as same user
if e.Action == "review_requested" {
p.logger.Debug().Str("actor", event.Actor.GiteaUsername).Msg("skipping actor filter for review_requested (CI automation)")
} else {
beforeFilter := len(usersToNotify)
usersToNotify = p.filterOutActor(usersToNotify, event.Actor)
p.logger.Debug().
Int("before_filter", beforeFilter).
Int("after_filter", len(usersToNotify)).
Str("actor_filtered", event.Actor.GiteaUsername).
Msg("filtered out actor from notifications")
}
// Send notifications
p.sendNotifications(ctx, event, usersToNotify)
@@ -402,10 +406,10 @@ func (p *Processor) sendNotifications(ctx context.Context, event *Event, users [
// filterOutActor removes the event actor from the notification list
func (p *Processor) filterOutActor(users []struct {
user User
reason NotificationReason
reason NotificationReasol
}, actor User) []struct {
user User
reason NotificationReason
reason NotificationReasol
} {
var filtered []struct {
user User