Skip to content

Commit

Permalink
Fix dlang#191 - remove common attributes when not in PR title
Browse files Browse the repository at this point in the history
  • Loading branch information
berni44 committed Feb 21, 2021
1 parent 10ce8a1 commit 6ecbd56
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions source/dlangbot/github.d
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ void searchForAutoMergePrs(string repoSlug)

/**
Allows contributors to use [<label>] messages in the title.
If they are part of a pre-defined, allowed list, the bot will add the
respective label.
If they are part of a pre-defined, allowed list, the bot will add and
remove the respective label.
*/
void checkTitleForLabels(in ref PullRequest pr)
{
Expand Down Expand Up @@ -356,4 +356,12 @@ void checkTitleForLabels(in ref PullRequest pr)

if (mappedLabels.length)
pr.addLabels(mappedLabels);

auto notMappedLabels = userLabelsMap
.values
.filter!(l => !mappedLabels.canFind(l))
.array;

if (notMappedLabels.length)
checkAndRemoveLabels(pr.labels, pr, notMappedLabels);
}

0 comments on commit 6ecbd56

Please sign in to comment.