update changelog + fix script to not miss entries
This commit is contained in:
parent
d642c0e12f
commit
ae9638c353
2 changed files with 977 additions and 24 deletions
961
CHANGELOG.md
961
CHANGELOG.md
File diff suppressed because it is too large
Load diff
40
warm.js
40
warm.js
|
|
@ -1,14 +1,30 @@
|
||||||
fetch('https://codeberg.org/api/v1/repos/uzu/strudel/pulls?state=closed&page=1')
|
// this script loads all merged PRs within the given page range
|
||||||
.then((res) => res.json())
|
// it can be used to update the CHANGELOG.md file in a semi-automated way
|
||||||
.then((pulls) => {
|
// the problem: codeberg doesn't support loading merged PRs, so we have to filter them in memory
|
||||||
const r = pulls
|
// luckily, we can sort after "recentupdate", which means we can do incremental changelog generation
|
||||||
.filter((pull) => pull.merged)
|
// todo: support setting a "last_updated" date, so the script would automatically check how far it has to go
|
||||||
.sort((a, b) => new Date(b.closed_at) - new Date(a.closed_at))
|
|
||||||
.map((pull) => `${pull.closed_at} ${pull.title} by ${pull.user.login || '?'} in: [#${pull.number}](${pull.url}) `)
|
|
||||||
.join('\n');
|
|
||||||
console.log(r);
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
async function main() {
|
||||||
|
let pageStart = 1;
|
||||||
|
let pageEnd = 1;
|
||||||
|
let prs = [];
|
||||||
|
for (let p = pageStart; p <= pageEnd; p++) {
|
||||||
|
console.log(`load page ${p}/${pageEnd}`);
|
||||||
|
const res = await fetch(
|
||||||
|
`https://codeberg.org/api/v1/repos/uzu/strudel/pulls?state=closed&sort=recentupdate&page=${p}`,
|
||||||
|
);
|
||||||
|
const pulls = await res.json();
|
||||||
|
const merged = pulls.filter((pull) => pull.merged);
|
||||||
|
prs = prs.concat(merged);
|
||||||
|
}
|
||||||
|
const output = prs
|
||||||
|
.sort((a, b) => new Date(b.closed_at) - new Date(a.closed_at))
|
||||||
|
.map(
|
||||||
|
(pull) => `- ${pull.closed_at} ${pull.title} by @${pull.user.login || '?'} in: [#${pull.number}](${pull.url}) `,
|
||||||
|
)
|
||||||
|
.join('\n');
|
||||||
|
console.log('-------------');
|
||||||
|
console.log(output);
|
||||||
|
}
|
||||||
|
|
||||||
*/
|
main();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue