fix bot
This commit is contained in:
parent
2562eb19af
commit
7ec9d057e0
|
@ -171,7 +171,9 @@ jobs:
|
||||||
|
|
||||||
for (const match of promptMatches) {
|
for (const match of promptMatches) {
|
||||||
const actName = normalizeTitle(match[1]);
|
const actName = normalizeTitle(match[1]);
|
||||||
const promptText = match[2].trim();
|
const promptText = match[2].trim()
|
||||||
|
.replace(/^(?:Contributed by:?[^\n]*\n\s*)+/i, '')
|
||||||
|
.trim();
|
||||||
const contributorLine = addedLines.match(/Contributed by: \[@([^\]]+)\]\(https:\/\/github\.com\/([^\)]+)\)/);
|
const contributorLine = addedLines.match(/Contributed by: \[@([^\]]+)\]\(https:\/\/github\.com\/([^\)]+)\)/);
|
||||||
const contributorInfo = contributorLine
|
const contributorInfo = contributorLine
|
||||||
? `Contributed by: [@${contributorLine[1]}](https://github.com/${contributorLine[2]})`
|
? `Contributed by: [@${contributorLine[1]}](https://github.com/${contributorLine[2]})`
|
||||||
|
@ -201,7 +203,9 @@ jobs:
|
||||||
const matches = [...line.matchAll(/"([^"]*(?:""[^"]*)*)"/g)];
|
const matches = [...line.matchAll(/"([^"]*(?:""[^"]*)*)"/g)];
|
||||||
if (matches.length >= 2) {
|
if (matches.length >= 2) {
|
||||||
const actName = normalizeTitle(matches[0][1].replace(/""/g, '"').trim());
|
const actName = normalizeTitle(matches[0][1].replace(/""/g, '"').trim());
|
||||||
const promptText = matches[1][1].replace(/""/g, '"').trim();
|
const promptText = matches[1][1].replace(/""/g, '"').trim()
|
||||||
|
.replace(/^(?:Contributed by:?[^\n]*\n\s*)+/i, '')
|
||||||
|
.trim();
|
||||||
|
|
||||||
const contributorInfo = `Contributed by: [@${pr.user.login}](https://github.com/${pr.user.login})`;
|
const contributorInfo = `Contributed by: [@${pr.user.login}](https://github.com/${pr.user.login})`;
|
||||||
prompts.set(actName.toLowerCase(), { actName, promptText, contributorInfo });
|
prompts.set(actName.toLowerCase(), { actName, promptText, contributorInfo });
|
||||||
|
|
Loading…
Reference in New Issue