diff --git a/lib/merge.js b/lib/merge.js index 1da82b5f..6404b1dd 100644 --- a/lib/merge.js +++ b/lib/merge.js @@ -97,23 +97,20 @@ async function removeLabels(octokit, pullRequest, mergeRemoveLabels) { return; } - logger.debug( - "Removing labels:", - labels.map(label => label.name) - ); + const labelNames = labels.map(label => label.name); - await Promise.all( - labels.map(label => - octokit.issues.deleteLabel({ - owner: pullRequest.base.repo.owner.login, - repo: pullRequest.base.repo.name, - issue_number: pullRequest.number, - name: label.name - }) - ) - ); + logger.debug("Removing labels:", labelNames); + + for (const name of labelNames) { + await octokit.issues.removeLabel({ + owner: pullRequest.base.repo.owner.login, + repo: pullRequest.base.repo.name, + issue_number: pullRequest.number, + name + }); + } - logger.info("Removed labels:", labels); + logger.info("Removed labels:", labelNames); } async function deleteBranch(octokit, pullRequest) {