Skip to content

Commit

Permalink
fix label removal check
Browse files Browse the repository at this point in the history
  • Loading branch information
pitaj committed Sep 29, 2023
1 parent a27cc0f commit 126cac5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/handlers/no_merges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ pub(super) async fn handle_input(

if should_send {
if !first_time {
// Check if the labels are already set.
// Check if the labels are still set.
// Otherwise, they were probably removed manually.
if !event
.issue
.labels()
.iter()
.all(|label| config.labels.contains(&label.name))
{
let any_removed = config.labels.iter().any(|label| {
// No label on the issue matches.
event.issue.labels().iter().all(|l| &l.name != label)
});

if any_removed {
// Assume it was a false positive, so don't
// re-add the labels or send a message this time.
state.save().await?;
Expand Down

0 comments on commit 126cac5

Please sign in to comment.