Skip to content
Permalink
Browse files
fix: only translate when the issue is not invalid.
  • Loading branch information
plainheart committed Dec 1, 2021
1 parent f42f9a7 commit 99dca364bf36dc823d5924fb076aedc777cc6375
Showing 1 changed file with 5 additions and 3 deletions.
@@ -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 => {

0 comments on commit 99dca36

Please sign in to comment.