diff --git a/src/App.vue b/src/App.vue
index 8d0dd3935ec..7f5e4070f1c 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1092,7 +1092,7 @@ export default {
log.error(error)
}
},
- async getChangelogs(project, lastVersion, nextVersion, parseChangelog) {
+ async getChangelogs(project, prevTag, nextTag, parseChangelog) {
const changelogs = []
try {
@@ -1102,13 +1102,14 @@ export default {
const data = await response.json()
let start = false
+ let maxParse = 10
for (const release of data) {
- if (release.tag_name === lastVersion) {
+ if (release.tag_name === prevTag) {
break
}
- if (release.tag_name === nextVersion) {
+ if (release.tag_name === nextTag) {
start = true
}
@@ -1116,10 +1117,12 @@ export default {
if (release.draft || release.prerelease) continue
- changelogs.push(parseChangelog(release))
+ changelogs.push(parseChangelog(release, changelogs.length))
+
+ if (--maxParse === 0) break
// if last version is not defined just print the last
- if (!lastVersion) break
+ if (!prevTag) break
}
} catch (error) {
log.error(error)
@@ -1159,7 +1162,7 @@ export default {
'zwave-js-ui',
versions?.app ? 'v' + versions?.app : null,
'v' + currentVersion,
- (release) => {
+ (release, i) => {
release.body = release.body.replace(
new RegExp(
`#+ \\[${release.tag_name.replace(
@@ -1168,12 +1171,25 @@ export default {
)}\\]\\([^\\)]+\\)`,
'g'
),
- `## UI [${release.tag_name}](https://github.com/zwave-js/zwave-js-ui/releases/tag/${release.tag_name})`
+ `${i === 0 ? '# UI\n---\n' : ''}## [${
+ release.tag_name
+ }](https://github.com/zwave-js/zwave-js-ui/releases/tag/${
+ release.tag_name
+ })`
)
- return md()
+ let changelog = md()
.render(release.body)
- .replace('', '
')
+ .replace('', '')
+
+ if (i === 0) {
+ changelog = changelog.replace(
+ '