mirror of
https://github.com/github/codeql-action.git
synced 2026-05-01 19:30:49 +00:00
fix handling of backport changelog
This commit is contained in:
@@ -187,14 +187,18 @@ def process_changelog_for_backports(source_branch_major_version, target_branch_m
|
||||
|
||||
# until we find the first section, just duplicate all lines
|
||||
while True:
|
||||
found_first_section = False
|
||||
line = f.readline()
|
||||
if not line:
|
||||
raise Exception('Could not find any change sections in CHANGELOG.md') # EOF
|
||||
|
||||
output += line
|
||||
if line.startswith('## '):
|
||||
line = line.replace(f'## {source_branch_major_version}', f'## {target_branch_major_version}')
|
||||
# we have found the first section, so now handle things differently
|
||||
found_first_section = True
|
||||
|
||||
output += line
|
||||
if found_first_section:
|
||||
# we now handle things differently
|
||||
break
|
||||
|
||||
# found_content tracks whether we hit two headings in a row
|
||||
|
||||
Reference in New Issue
Block a user