mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-19 18:25:58 +08:00
feat: add question mark duplicate (#38)
* feat: add question mark duplicate * add package * add * up * up
This commit is contained in:
6
dist/index.js
vendored
6
dist/index.js
vendored
@@ -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(' ');
|
||||
|
Reference in New Issue
Block a user