From 16b79d170b9df9ea6b3f5eb94f86f2abcac886eb Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 13 Mar 2024 08:27:55 +0100 Subject: [PATCH] ci(common): Fix changelog: only add newline for new entries --- ci/changelog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/changelog.py b/ci/changelog.py index d3e6767ba..7cf262898 100644 --- a/ci/changelog.py +++ b/ci/changelog.py @@ -83,13 +83,14 @@ def main(): changelog += '\n### {}\n\n'.format(sections[section]) for it in item: changelog += '- {}\n'.format(it) - changelog += '\n' filename = os.path.join(root_path, 'components', component, 'CHANGELOG.md') # Check if the changelog file exists. if not os.path.exists(filename): # File does not exist, create it with open(filename, 'w') as file: file.write('# Changelog\n\n') + else: + changelog += '\n' # insert the actual changelog to the beginning of the file, just after the title (2nd line) with open(filename, 'r') as orig_changelog: changelog_title = orig_changelog.readline(