Files
Sparkle/Configurations/generate_latest_changes.py
Mayur Pawashe 30361b0128 Use a custom bot personal access token (#1930)
This bot has owner access to the repo and should be able to push changes to protected branches, as long as the workflows are being ran from trusted branches / remotes.

Also extract changelog and use it for the draft.
2021-09-02 23:13:37 -07:00

24 lines
717 B
Python
Executable File

#!/usr/bin/env python3
import os, sys
# Ignore the first version line starting with # x.y.z..
# and print everything until the second version line starting with # x.y.z..
hit_first_changelog_note = False
with open("CHANGELOG", "r") as changelog_file:
for line in changelog_file:
if line.startswith("#"):
if hit_first_changelog_note:
# We are done with printing changes
break
else:
# We haven't hit an important changelog line yet, so continue
continue
if not hit_first_changelog_note and len(line.strip()) == 0:
continue
hit_first_changelog_note = True
sys.stdout.write(line)