perf: expand duplicate action (#40)

* perf: expand duplicate action

* up
This commit is contained in:
xrkffgg
2021-01-13 11:08:56 +08:00
committed by GitHub
parent c7cf5de709
commit 7619e79b94
6 changed files with 90 additions and 90 deletions

View File

@@ -360,14 +360,14 @@ jobs:
#### `mark-duplicate`
Quickly mark duplicate questions, only for issue new comments.
Quickly mark duplicate questions, only for issue new comments or edit comments.
```yml
name: Issue Mark Duplicate
on:
issue_comment:
types: [created]
types: [created, edited]
jobs:
mark-duplicate:

View File

@@ -360,14 +360,14 @@ jobs:
#### `mark-duplicate`
快捷标记重复问题,仅作用于 issue 新增评论。
快捷标记重复问题,仅作用于 issue 新增编辑评论。
```yml
name: Issue Mark Duplicate
on:
issue_comment:
types: [created]
types: [created, edited]
jobs:
mark-duplicate:

8
dist/index.js vendored
View File

@@ -8026,11 +8026,8 @@ async function doMarkDuplicate (owner, repo, labels) {
core.info(`This actions only support on 'issue_comment'!`);
return false;
}
if (context.payload.action != 'created') {
core.info(`This actions only support on 'issue_comment' created!`);
return false;
}
if (context.payload.action == 'created' || context.payload.action == 'edited') {
const duplicateCommand = core.getInput("duplicate-command");
const duplicateLabels = core.getInput("duplicate-labels");
const removeLables = core.getInput("remove-labels");
@@ -8076,6 +8073,9 @@ async function doMarkDuplicate (owner, repo, labels) {
} else {
core.info(`This comment body should start whith 'duplicate-command' or 'Duplicate of' and not include '?'`);
}
} else {
core.info(`This actions only support on 'issue_comment' created or edited!`);
}
};
async function doOpenIssue (owner, repo, issueNumber) {

View File

@@ -234,14 +234,14 @@ jobs:
## `mark-duplicate`
Quickly mark duplicate questions, only for issue new comments.
Quickly mark duplicate questions, only for issue new comments or edit comments.
```yml
name: Issue Mark Duplicate
on:
issue_comment:
types: [created]
types: [created, edited]
jobs:
mark-duplicate:

View File

@@ -234,14 +234,14 @@ jobs:
## `mark-duplicate`
快捷标记重复问题,仅作用于 issue 新增评论。
快捷标记重复问题,仅作用于 issue 新增编辑评论。
```yml
name: Issue Mark Duplicate
on:
issue_comment:
types: [created]
types: [created, edited]
jobs:
mark-duplicate:

View File

@@ -155,11 +155,8 @@ async function doMarkDuplicate (owner, repo, labels) {
core.info(`This actions only support on 'issue_comment'!`);
return false;
}
if (context.payload.action != 'created') {
core.info(`This actions only support on 'issue_comment' created!`);
return false;
}
if (context.payload.action == 'created' || context.payload.action == 'edited') {
const duplicateCommand = core.getInput("duplicate-command");
const duplicateLabels = core.getInput("duplicate-labels");
const removeLables = core.getInput("remove-labels");
@@ -205,6 +202,9 @@ async function doMarkDuplicate (owner, repo, labels) {
} else {
core.info(`This comment body should start whith 'duplicate-command' or 'Duplicate of' and not include '?'`);
}
} else {
core.info(`This actions only support on 'issue_comment' created or edited!`);
}
};
async function doOpenIssue (owner, repo, issueNumber) {