You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2022/06/24 12:33:10 UTC

[echarts-bot] branch master updated: fix: fix `addLabels` & `removeLabels` don't work owing to missing `context` param

This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-bot.git


The following commit(s) were added to refs/heads/master by this push:
     new d07d4e0  fix: fix `addLabels` & `removeLabels` don't work owing to missing `context` param
d07d4e0 is described below

commit d07d4e0e374e00a3e483712e1da7671520f0ff76
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Fri Jun 24 20:30:27 2022 +0800

    fix: fix `addLabels` & `removeLabels` don't work owing to missing `context` param
---
 index.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index 5367741..435faa8 100644
--- a/index.js
+++ b/index.js
@@ -231,8 +231,8 @@ module.exports = (/** @type import('probot').Probot */ app) => {
 
         return Promise.all([
             commentIssue(context, commentText),
-            removeLabels(removeLabel),
-            addLabels(addLabel)
+            removeLabels(context, removeLabel),
+            addLabels(context, addLabel)
         ]);
     });
 
@@ -291,7 +291,7 @@ module.exports = (/** @type import('probot').Probot */ app) => {
  * @param {string} labelNames label names to be removed
  */
 function removeLabels(context, labelNames) {
-    return labelNames && Promise.all(
+    return labelNames && labelNames.length && Promise.all(
         labelNames.map(
             label => context.octokit.issues.removeLabel(
                 context.issue({


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org