Skip to content

Commit

Permalink
Sort only for module updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MultiQC Bot committed Sep 26, 2023
1 parent dd681f5 commit 300d62d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _skip_existing_entry_for_this_pr(line, same_section=True):
updated_lines.append(line)
break
continue

if inside_version_dev and line.lower().startswith(section.lower()): # Section of interest header
if already_added_entry:
print(f"Already added new lines into section {section}, is the section duplicated?", file=sys.stderr)
Expand All @@ -291,7 +291,10 @@ def _skip_existing_entry_for_this_pr(line, same_section=True):
if line.startswith("##"):
# Found the next section header, so need to put all the lines we collected.
updated_lines.append("\n")
updated_lines.extend(sorted([_l for _l in section_lines + new_lines if _l.strip()]))
_updated_lines = [_l for _l in section_lines + new_lines if _l.strip()]
if section == "### Module updates":
_updated_lines = sorted(_updated_lines)
updated_lines.extend(_updated_lines)
updated_lines.append("\n")
print(f"Updated {changelog_path} section '{section}' with lines:\n" + "".join(new_lines))
already_added_entry = True
Expand Down

0 comments on commit 300d62d

Please sign in to comment.