mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 23:39:40 +07:00
Hopefully fixed commit parsing
This commit is contained in:
@ -58,7 +58,7 @@ async function parseCommits() {
|
|||||||
if (commitMessage.startsWith("Merge ") || commitMessage.startsWith("Update ")) return;
|
if (commitMessage.startsWith("Merge ") || commitMessage.startsWith("Update ")) return;
|
||||||
commitMessage = commitMessage.replace(/\(\#\d+\)/, "").replace(/\#\d+/, ""); // match PR auto-text, like (#2345) or just #2345
|
commitMessage = commitMessage.replace(/\(\#\d+\)/, "").replace(/\#\d+/, ""); // match PR auto-text, like (#2345) or just #2345
|
||||||
if (author !== "yairm210") {
|
if (author !== "yairm210") {
|
||||||
if (typeof ownerToCommits[author] === "undefined") ownerToCommits[author] = [];
|
if (!(author in ownerToCommits)) ownerToCommits[author] = [];
|
||||||
ownerToCommits[author].push(commitMessage);
|
ownerToCommits[author].push(commitMessage);
|
||||||
} else {
|
} else {
|
||||||
commitSummary += "\n\n" + commitMessage;
|
commitSummary += "\n\n" + commitMessage;
|
||||||
@ -66,14 +66,14 @@ async function parseCommits() {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
Object.entries(ownerToCommits).forEach((author,index, commits) => {
|
for (const [author, commits] of Object.entries(ownerToCommits)) {
|
||||||
if (commits.length === 1) {
|
if (commits.length === 1) {
|
||||||
commitSummary += "\n\n" + commits[0] + " - By " + author;
|
commitSummary += "\n\n" + commits[0] + " - By " + author;
|
||||||
} else {
|
} else {
|
||||||
commitSummary += "\n\nBy " + author + ":";
|
commitSummary += "\n\nBy " + author + ":";
|
||||||
commits.forEach(commitMessage => { commitSummary += "\n- " + commitMessage });
|
commits.forEach(commitMessage => { commitSummary += "\n- " + commitMessage });
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
console.log(commitSummary);
|
console.log(commitSummary);
|
||||||
return [nextVersionString, commitSummary];
|
return [nextVersionString, commitSummary];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user