feat: add question mark duplicate (#38)

* feat: add question mark duplicate

* add package

* add

* up

* up
This commit is contained in:
xrkffgg
2021-01-13 09:32:46 +08:00
committed by GitHub
parent 273b6abb78
commit c7cf5de709
7 changed files with 10 additions and 10 deletions

6
dist/index.js vendored
View File

@@ -8042,7 +8042,7 @@ async function doMarkDuplicate (owner, repo, labels) {
const ifCommandInput = !!duplicateCommand;
if ((ifCommandInput && commentBody.startsWith(duplicateCommand) && commentBody.split(' ')[0] == duplicateCommand) || testDuplicate(commentBody)) {
if (!commentBody.includes('?') && ((ifCommandInput && commentBody.startsWith(duplicateCommand) && commentBody.split(' ')[0] == duplicateCommand) || testDuplicate(commentBody))) {
if (ifCommandInput) {
const nextBody = commentBody.replace(duplicateCommand, 'Duplicate of');
await doUpdateComment(owner, repo, commentId, nextBody, 'replace', true);
@@ -8074,7 +8074,7 @@ async function doMarkDuplicate (owner, repo, labels) {
await doCloseIssue(owner, repo, issueNumber);
}
} else {
core.info(`This comment body should start whith 'duplicate-command'`);
core.info(`This comment body should start whith 'duplicate-command' or 'Duplicate of' and not include '?'`);
}
};
@@ -8732,7 +8732,7 @@ function matchKeyword (content, keywords) {
function testDuplicate(body) {
if (!body || !body.startsWith('Duplicate of')) {
return false
return false;
}
let arr = body.split(' ');