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 2021/03/29 02:53:43 UTC
[echarts-bot] branch master updated: fix: don't add `awaiting
review` if the PR is draft.
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 c186fc8 fix: don't add `awaiting review` if the PR is draft.
c186fc8 is described below
commit c186fc8f670489c883a4ea6cc3d30b85167b5256
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Mon Mar 29 10:50:30 2021 +0800
fix: don't add `awaiting review` if the PR is draft.
---
index.js | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/index.js b/index.js
index dbf2913..5ba0e4a 100644
--- a/index.js
+++ b/index.js
@@ -190,13 +190,16 @@ module.exports = (app) => {
});
app.on(['pull_request.synchronize'], async context => {
- const addLabel = context.octokit.issues.addLabels(
- context.issue({
- labels: ['PR: awaiting review']
- })
- );
+ let addLabel;
const removeLabel = getRemoveLabel(context, 'PR: revision needed');
- return Promise.all([addLabel, removeLabel]);
+ if (!context.payload.pull_request.draft) {
+ addLabel = context.octokit.issues.addLabels(
+ context.issue({
+ labels: ['PR: awaiting review']
+ })
+ );
+ }
+ return Promise.all([removeLabel, addLabel]);
});
app.on(['pull_request.closed'], async context => {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org