Skip to content

Commit 16b79d1

Browse files
committed
ci(common): Fix changelog: only add newline for new entries
1 parent dfb0035 commit 16b79d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ci/changelog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,14 @@ def main():
8383
changelog += '\n### {}\n\n'.format(sections[section])
8484
for it in item:
8585
changelog += '- {}\n'.format(it)
86-
changelog += '\n'
8786
filename = os.path.join(root_path, 'components', component, 'CHANGELOG.md')
8887
# Check if the changelog file exists.
8988
if not os.path.exists(filename):
9089
# File does not exist, create it
9190
with open(filename, 'w') as file:
9291
file.write('# Changelog\n\n')
92+
else:
93+
changelog += '\n'
9394
# insert the actual changelog to the beginning of the file, just after the title (2nd line)
9495
with open(filename, 'r') as orig_changelog:
9596
changelog_title = orig_changelog.readline(

0 commit comments

Comments
 (0)