feat: sort issues

This commit is contained in:
monoid 2022-04-19 18:30:41 +09:00
parent 82a66202fc
commit ef8a8a967f

View File

@ -5,6 +5,7 @@ type Issue = {
url: string; url: string;
title: string; title: string;
body: string; body: string;
number: number,
labels: { labels: {
name: string; name: string;
}[] }[]
@ -39,5 +40,6 @@ if (import.meta.main) {
Deno.exit(1); Deno.exit(1);
} }
const issues = await getIssues("vi117/scrap-yard", token); const issues = await getIssues("vi117/scrap-yard", token);
console.log(issues.map(i => `# ${i.title}\n${i.body}`).join("\n\n")); issues.sort((a, b) => a.number - b.number);
console.log(issues.map(i => `# (${i.number}) ${i.title}\n${i.body}`).join("\n\n"));
} }