Skip to content

Commit 126cac5

Browse files
committed
fix label removal check
1 parent a27cc0f commit 126cac5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/handlers/no_merges.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ pub(super) async fn handle_input(
135135

136136
if should_send {
137137
if !first_time {
138-
// Check if the labels are already set.
138+
// Check if the labels are still set.
139139
// Otherwise, they were probably removed manually.
140-
if !event
141-
.issue
142-
.labels()
143-
.iter()
144-
.all(|label| config.labels.contains(&label.name))
145-
{
140+
let any_removed = config.labels.iter().any(|label| {
141+
// No label on the issue matches.
142+
event.issue.labels().iter().all(|l| &l.name != label)
143+
});
144+
145+
if any_removed {
146146
// Assume it was a false positive, so don't
147147
// re-add the labels or send a message this time.
148148
state.save().await?;

0 commit comments

Comments
 (0)