Skip to content

Commit

Permalink
Ignore merge commits in release notes generation
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Jul 4, 2024
1 parent 9339340 commit 66a9ac7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/utils/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ def get_commit_list(git_url: str, start: str, end: str) -> List[str]:

def get_release_notes(git_url: str, start: str, end: str) -> Optional[str]:
commits = get_commit_list(git_url, start, end)
commits = [x for x in commits if not x.startswith("Merge ")]
if len(commits) == 0:
return None

return normalize_line_endings("\n".join(map(lambda x: f"- {x}", commits)) + f"\n<!-- auto from {start} to {end} -->")
text = "\n".join(map(lambda x: f"- {x}", commits)) + f"\n<!-- auto from {start[0:5]} to {end[0:5]} -->"
return normalize_line_endings(text)

0 comments on commit 66a9ac7

Please sign in to comment.