Skip to content

Commit a121412

Browse files
authored
Merge pull request #51 from wilzbach/remove-needs-rebase
Remove 'needs rebase' and 'needs work' on new push
2 parents 31257a0 + bc5c958 commit a121412

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

source/dlangbot/app.d

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ void handlePR(string action, PullRequest pr)
181181
return;
182182
if (action == "synchronize")
183183
{
184-
checkAndRemoveMergeLabels(labelsAndCommits.labels, pr);
184+
enum toRemoveLabels = ["auto-merge", "auto-merge-squash",
185+
"needs rebase", "needs work"];
186+
checkAndRemoveLabels(labelsAndCommits.labels, pr, toRemoveLabels);
185187
if (labelsAndCommits.commits !is null)
186188
commits = labelsAndCommits.commits;
187189
}

source/dlangbot/github.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,11 @@ Json[] tryMerge(in ref PullRequest pr, MergeMethod method)
229229
return commits;
230230
}
231231

232-
void checkAndRemoveMergeLabels(Json[] labels, in ref PullRequest pr)
232+
void checkAndRemoveLabels(Json[] labels, in ref PullRequest pr, in string[] toRemoveLabels)
233233
{
234234
labels
235235
.map!(l => l["name"].get!string)
236-
.filter!(n => n.startsWith("auto-merge"))
236+
.filter!(n => toRemoveLabels.canFind(n))
237237
.each!(l => pr.removeLabel(l));
238238
}
239239

0 commit comments

Comments
 (0)