Skip to content

Commit 56314f6

Browse files
Sumit189lunny
andauthored
Update modules/actions/workflows.go
Co-authored-by: Lunny Xiao <[email protected]>
1 parent 6664116 commit 56314f6

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

modules/actions/workflows.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,17 +370,12 @@ func matchIssuesEvent(issuePayload *api.IssuePayload, evt *jobparser.Event) bool
370370
actions := []string{}
371371
switch issuePayload.Action {
372372
case api.HookIssueLabelUpdated:
373-
// Check if both labels were added and removed to determine events to fire
374-
if len(issuePayload.Issue.Labels) > 0 && len(issuePayload.RemovedLabels) > 0 {
375-
// Both labeled and unlabeled events should be triggered
376-
actions = append(actions, "labeled", "unlabeled")
377-
} else if len(issuePayload.RemovedLabels) > 0 {
378-
// Only labels were removed
379-
actions = append(actions, "unlabeled")
380-
} else {
381-
// Only labels were added
373+
if len(issuePayload.Issue.Labels) > 0 {
382374
actions = append(actions, "labeled")
383375
}
376+
if len(issuePayload.RemovedLabels) > 0 {
377+
actions = append(actions, "unlabeled")
378+
}
384379
case api.HookIssueLabelCleared:
385380
actions = append(actions, "unlabeled")
386381
default:

0 commit comments

Comments
 (0)