From 56314f605ac5fbd5226f67ec99e23e6692e1b98f Mon Sep 17 00:00:00 2001 From: Sumit Date: Tue, 29 Apr 2025 23:51:49 +0530 Subject: [PATCH] Update modules/actions/workflows.go Co-authored-by: Lunny Xiao --- modules/actions/workflows.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/actions/workflows.go b/modules/actions/workflows.go index c2ca769d39..3319f0de61 100644 --- a/modules/actions/workflows.go +++ b/modules/actions/workflows.go @@ -370,17 +370,12 @@ func matchIssuesEvent(issuePayload *api.IssuePayload, evt *jobparser.Event) bool actions := []string{} switch issuePayload.Action { case api.HookIssueLabelUpdated: - // Check if both labels were added and removed to determine events to fire - if len(issuePayload.Issue.Labels) > 0 && len(issuePayload.RemovedLabels) > 0 { - // Both labeled and unlabeled events should be triggered - actions = append(actions, "labeled", "unlabeled") - } else if len(issuePayload.RemovedLabels) > 0 { - // Only labels were removed - actions = append(actions, "unlabeled") - } else { - // Only labels were added + if len(issuePayload.Issue.Labels) > 0 { actions = append(actions, "labeled") } + if len(issuePayload.RemovedLabels) > 0 { + actions = append(actions, "unlabeled") + } case api.HookIssueLabelCleared: actions = append(actions, "unlabeled") default: