Skip to content

Commit baef6f0

Browse files
Fix CHANGELOG space errors (#1647)
1 parent 107df3f commit baef6f0

File tree

2 files changed

+418
-416
lines changed

2 files changed

+418
-416
lines changed

.github/workflows/update-changelog.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ jobs:
4343
throw new Error(`changelog already includes ${release.data.name}`);
4444
}
4545
const newEntry = `# ${release.data.name}\n${release.data.body}`;
46-
const updatedChangelog = changelog.replace(placeholder, placeholder + '\n\n' + newEntry + '\n---\n');
46+
let updatedChangelog = changelog.replace(placeholder, placeholder + '\n\n' + newEntry + '\n---\n');
47+
// if the release notes are modified in the GitHub web editor, trailing spaces can be added accidentally
48+
updatedChangelog = updatedChangelog.replace(/\s+$/, '');
4749
fs.writeFileSync(changelogPath, updatedChangelog);
4850
- uses: peter-evans/create-pull-request@v4
4951
with:

0 commit comments

Comments
 (0)