1
0
mirror of https://github.com/spacebarchat/spacebarchat.git synced 2024-11-08 19:52:36 +01:00

add Route: to route issues

This commit is contained in:
Flam3rboy 2021-08-10 03:39:09 +02:00
parent b18d6d5b7e
commit e76eed3568

View File

@ -23,22 +23,8 @@ async function main() {
do {
var issues = await request(`/repos/${organization}/${repo}/issues?state=all&per_page=100&page=${page}`);
for (const issue of issues) {
const replacer = [
"[Feature]",
"[BUG]",
"[Bug]",
"[Security]",
"[Route]",
"[Voice]",
"[Page]",
"[Media]",
"[Gateway]",
"[Fix]",
"[Plugin]",
];
const newTitle = replacer.reduce((acc, curr) => acc.replace(curr, ""), issue.title).trim();
if (newTitle !== issue.title) {
if (issue.labels.some((label) => label.name === "Route")) {
const newTitle = `Route: ${issue.title}`;
console.log(`old: ${issue.title}, new: ${newTitle}`, issue.number);
// continue;
await request(`/repos/${organization}/${repo}/issues/${issue.number}`, {