Skip to content

Instantly share code, notes, and snippets.

@mega-arbuz
Last active February 9, 2019 22:57
Show Gist options
  • Save mega-arbuz/a3a87ed7ed1a8e7d6ba3df4f6d04d680 to your computer and use it in GitHub Desktop.
Save mega-arbuz/a3a87ed7ed1a8e7d6ba3df4f6d04d680 to your computer and use it in GitHub Desktop.
Extract latest changes from changelog file
def get_changes(change_log_path):
with(open(change_log_path)) as change_log_file:
change_log = change_log_file.read()
# Split by '##' and remove lines starting with '#'
latest_version_changes = change_log.split('##')[0][:-1]
latest_version_changes = re.sub('^#.*\n?', '', latest_version_changes, flags=re.MULTILINE)
return latest_version_changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment