Merge pull request #2241 from github/nickfyson/speculative-script-fix
fix handling of backport changelog
This commit is contained in:
commit
9b87e0a8c4
1 changed files with 5 additions and 4 deletions
9
.github/update-release-branch.py
vendored
9
.github/update-release-branch.py
vendored
|
|
@ -186,16 +186,17 @@ def process_changelog_for_backports(source_branch_major_version, target_branch_m
|
|||
with open('CHANGELOG.md', 'r') as f:
|
||||
|
||||
# until we find the first section, just duplicate all lines
|
||||
while True:
|
||||
found_first_section = False
|
||||
while not found_first_section:
|
||||
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
|
||||
break
|
||||
found_first_section = True
|
||||
|
||||
output += line
|
||||
|
||||
# found_content tracks whether we hit two headings in a row
|
||||
found_content = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue