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 7295be2 chore: add types and some comments. new b1f2cc5 Merge branch 'master' of https://github.com/apache/echarts-bot 7295be2 is described below commit 7295be2344123663ae2d09b4c0a0b50fc517dcec Author: plainheart <y...@all-my-life.cn> AuthorDate: Mon Nov 29 11:28:08 2021 +0800 chore: add types and some comments. --- index.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3e67625..16eb287 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ const { isCommitter } = require('./src/coreCommitters'); const logger = require('./src/logger'); const { replaceAll, removeHTMLComment } = require('./src/util'); -module.exports = (app) => { +module.exports = (/** @type import('probot').Probot */ app) => { app.on(['issues.opened'], async context => { const issue = new Issue(context); @@ -284,6 +284,9 @@ function getRemoveLabel(context, name) { }); } +/** + * @param {import('probot').Context} context + */ function closeIssue(context) { // close issue return context.octokit.issues.update( @@ -293,6 +296,10 @@ function closeIssue(context) { ); } +/** + * @param {import('probot').Context} context + * @param {string} commentText + */ function commentIssue(context, commentText) { // create comment return context.octokit.issues.createComment( @@ -302,6 +309,9 @@ function commentIssue(context, commentText) { ); } +/** + * @param {import('probot').Context} context + */ async function isFirstTimeContributor(context) { try { const response = await context.octokit.issues.listForRepo( @@ -318,6 +328,10 @@ async function isFirstTimeContributor(context) { } } +/** + * @param {import('probot').Context} context + * @param {Issue} createdIssue + */ async function translateIssue(context, createdIssue) { if (!createdIssue) { return; @@ -350,6 +364,9 @@ async function translateIssue(context, createdIssue) { } } +/** + * @param {string} body + */ function fixMarkdown(body) { return body.replace(/\! \[/g, '![').replace(/\] \(/g, '](') } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org