Install oktokit in changelog workflow (#901)

* install oktokit in changelog workflow

* fix how the old changelog is cut off
This commit is contained in:
Alberto Iannaccone
2022-03-14 12:05:53 +01:00
committed by GitHub
parent 8cac0872a4
commit 61c2b1a007
2 changed files with 3 additions and 4 deletions

View File

@@ -81,11 +81,9 @@ export class IDEUpdaterImpl implements IDEUpdater {
? await fetch(`${CHANGELOG_BASE_URL}/${latestChangelogFileName}`)
: null;
const changelog = response?.ok ? await response?.text() : null;
const currentVersionHeader = `\n\n---\n\n## ${this.updater.currentVersion}\n\n`;
// We only want to see the release notes of newer versions
const currentVersionIndex = changelog?.indexOf(
`\r\n\r\n---\r\n\r\n## ${this.updater.currentVersion}\r\n\r\n`
);
const currentVersionIndex = changelog?.indexOf(currentVersionHeader);
const newChangelog =
currentVersionIndex && currentVersionIndex > 0
? changelog?.slice(0, currentVersionIndex)