You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2022/06/14 06:54:56 UTC

[echarts-bot] branch master updated: fix: doc template comment logic

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

ovilia 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 d6f2469  fix: doc template comment logic
d6f2469 is described below

commit d6f2469c18c33331afb73b82ba3627a39e78bd61
Author: Ovilia <zw...@gmail.com>
AuthorDate: Tue Jun 14 14:54:48 2022 +0800

    fix: doc template comment logic
---
 index.js    | 8 ++++----
 src/text.js | 4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/index.js b/index.js
index 8beb751..368c612 100644
--- a/index.js
+++ b/index.js
@@ -188,7 +188,7 @@ module.exports = (/** @type import('probot').Probot */ app) => {
 
         const content = context.payload.pull_request.body || '';
 
-        commentText = checkDoc(content, labelList, removeLabelList);
+        commentText = checkDoc(content, commentText, labelList, removeLabelList);
 
         if (content.indexOf('[x] This PR depends on ZRender changes') > -1) {
             commentText += text.PR_ZRENDER_CHANGED;
@@ -431,17 +431,17 @@ function checkDoc(content, commentText, addLabelList, removeLabelList) {
         }
     }
     else {
-        if (content.indexOf('[x] ' + text.PR_DOC_RREADY)) {
+        if (content.indexOf('[x] ' + text.PR_DOC_RREADY) >= 0) {
             addLabelList.push(labelText.PR_DOC_READY);
             removeLabelList.push(labelText.PR_DOC_UNCHANGED);
             removeLabelList.push(labelText.PR_DOC_LATER);
         }
-        else if (content.indexOf('[x] ' + text.PR_DOC_UNCHANGED)) {
+        else if (content.indexOf('[x] ' + text.PR_DOC_UNCHANGED) >= 0) {
             addLabelList.push(labelText.PR_DOC_UNCHANGED);
             removeLabelList.push(labelText.PR_DOC_READY);
             removeLabelList.push(labelText.PR_DOC_LATER);
         }
-        else if (content.indexOf('[x] ' + text.PR_DOC_LATER)) {
+        else if (content.indexOf('[x] ' + text.PR_DOC_LATER) >= 0) {
             addLabelList.push(labelText.PR_AWAITING_DOC);
             removeLabelList.push(labelText.PR_DOC_UNCHANGED);
             removeLabelList.push(labelText.PR_DOC_READY);
diff --git a/src/text.js b/src/text.js
index cab9ba9..1ac160b 100644
--- a/src/text.js
+++ b/src/text.js
@@ -57,7 +57,9 @@ const PR_DOC_UNCHANGED = `This PR doesn't relate to document changes`;
 const PR_DOC_LATER = `The document should be updated later`;
 const PR_DOC_RREADY = `The document changes have been made`;
 
-const PR_DOC_LAGACY = `Please make sure this PR has one of the following labels: \`PR: doc ready\`, \`PR: doc awaiting\`, \`PR: doc unchanged\``;
+const PR_DOC_LAGACY = `To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: \`PR: doc ready\`, \`PR: doc awaiting\`, \`PR: doc unchanged\`
+
+This message is shown because the PR description doesn't contain the document related template.`;
 
 const PR_MISSING_DOC_INFO = `
 


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