mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-23 14:23:39 +08:00
build: merge quote report commits in changelog generation
This commit is contained in:
parent
b869e36bf3
commit
6972462083
1 changed files with 27 additions and 0 deletions
|
@ -66,6 +66,17 @@ function itemIsAddingQuotes(item) {
|
|||
return scopeIsQuote && messageAdds;
|
||||
}
|
||||
|
||||
function itemIsAddressingQuoteReports(item) {
|
||||
const scopeIsQuote =
|
||||
item.scope?.includes("quote") || item.scope?.includes("quotes");
|
||||
|
||||
const messageReport =
|
||||
item.message.includes("quote") &&
|
||||
(item.message.includes("report") || item.message.includes("reports"));
|
||||
|
||||
return scopeIsQuote && messageReport;
|
||||
}
|
||||
|
||||
const titles = {
|
||||
feat: "Features",
|
||||
impr: "Improvements",
|
||||
|
@ -159,6 +170,11 @@ async function main() {
|
|||
let quoteAddCommits = log.filter((item) => itemIsAddingQuotes(item));
|
||||
log = log.filter((item) => !itemIsAddingQuotes(item));
|
||||
|
||||
let quoteReportCommits = log.filter((item) =>
|
||||
itemIsAddressingQuoteReports(item)
|
||||
);
|
||||
log = log.filter((item) => !itemIsAddressingQuoteReports(item));
|
||||
|
||||
if (quoteAddCommits.length > 0) {
|
||||
log.push({
|
||||
hashes: quoteAddCommits.map((item) => item.hashes).flat(),
|
||||
|
@ -170,6 +186,17 @@ async function main() {
|
|||
});
|
||||
}
|
||||
|
||||
if (quoteReportCommits.length > 0) {
|
||||
log.push({
|
||||
hashes: quoteReportCommits.map((item) => item.hashes).flat(),
|
||||
type: "fix",
|
||||
scope: "quote",
|
||||
message: "update or remove quotes reported by users",
|
||||
usernames: quoteReportCommits.map((item) => item.usernames).flat(),
|
||||
prs: quoteReportCommits.map((item) => item.prs).flat(),
|
||||
});
|
||||
}
|
||||
|
||||
let final = "";
|
||||
|
||||
final += header + "\n\n\n";
|
||||
|
|
Loading…
Reference in a new issue