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 99dca36  fix: only translate when the issue is not invalid.
99dca36 is described below

commit 99dca364bf36dc823d5924fb076aedc777cc6375
Author: plainheart <[email protected]>
AuthorDate: Wed Dec 1 14:20:06 2021 +0800

    fix: only translate when the issue is not invalid.
---
 index.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index 3aa96b4..aafa94e 100644
--- a/index.js
+++ b/index.js
@@ -11,7 +11,7 @@ module.exports = (/** @type import('probot').Probot */ app) 
=> {
 
         await issue.init();
 
-        // await commentIssue(context, text.ISSUE_CREATED);
+        // issue.response && await commentIssue(context, issue.response);
 
         const addLabels = issue.addLabels.length
             && context.octokit.issues.addLabels(
@@ -25,8 +25,10 @@ module.exports = (/** @type import('probot').Probot */ app) 
=> {
         // add and remove label
         await Promise.all([addLabels, removeLabel]);
 
-        // translate finally
-        return translateIssue(context, issue);
+        const invalid = addLabels.includes(labelText.INVALID);
+
+        // translate finally if valid
+        return invalid || translateIssue(context, issue);
     });
 
     app.on(['issues.closed'], context => {

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to