Skip to content
Snippets Groups Projects
Commit 43be8544 authored by Ciro Santilli's avatar Ciro Santilli
Browse files

fix new issue bot

parent 2d8f9784
No related branches found
No related tags found
No related merge requests found
......@@ -59,9 +59,12 @@ if (isComment) {
author = payload.issue.user.login;
}
const quoteArray = [];
const noQuoteArray = [];
for (const line of titleAndBody.split('\n')) {
// Remove some speical chars to remove at mention spam possibilities.
quoteArray.push('> ' + line.replace(/[@#]/g, ""));
const l = line.replace(/[@#]/g, "")
quoteArray.push('> ' + l);
noQuoteArray.push(l);
}
const replyBody = `Hi @${author},
......@@ -170,12 +173,12 @@ try {
body: replyBody,
});
if (isComment) {
const title = (`@${author}: ` + replyBody.replaceAll('\n', ' ')).substring(0, 255)
const title = (`@${author}: ` + quoteArray.join('\n').replaceAll('\n', ' ')).substring(0, 255)
const new_issue = octokit.issues.create({
owner: payload.repository.owner.login,
repo: payload.repository.name,
title,
body: replyBody,
body: payload.comment.html_url + '\n\n' + replyBody,
})
} else {
// Update labels.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment