Skip to content

Commit

Permalink
Don't steal pull request
Browse files Browse the repository at this point in the history
If a pull request has already a milestone (=> consider as be in an other
release) don't put it in the new release.
  • Loading branch information
sbrunner committed Oct 28, 2024
1 parent bcdc9e4 commit 4394c4e
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions github_app_geo_project/module/standard/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,23 +386,24 @@ def generate_changelog(
has_pr = False
for pull_request in commit.get_pulls():
has_pr = True
authors = {Author(pull_request.user.login, pull_request.user.html_url)}
for commit_ in pull_request.get_commits():
if commit_.author is not None:
authors.add(Author(commit_.author.login, commit_.author.html_url))
pull_request.as_issue().edit(milestone=milestone)
changelog_items.add(
ChangelogItem(
github=pull_request,
ref=f"#{pull_request.number}",
title=pull_request.title,
author=Author(pull_request.user.login, pull_request.user.html_url),
authors=authors,
branch=pull_request.head.ref,
files={github_file.filename for github_file in pull_request.get_files()},
labels={label.name for label in pull_request.get_labels()},
if pull_request.milestone is None:
authors = {Author(pull_request.user.login, pull_request.user.html_url)}
for commit_ in pull_request.get_commits():
if commit_.author is not None:
authors.add(Author(commit_.author.login, commit_.author.html_url))
pull_request.as_issue().edit(milestone=milestone)
changelog_items.add(
ChangelogItem(
github=pull_request,
ref=f"#{pull_request.number}",
title=pull_request.title,
author=Author(pull_request.user.login, pull_request.user.html_url),
authors=authors,
branch=pull_request.head.ref,
files={github_file.filename for github_file in pull_request.get_files()},
labels={label.name for label in pull_request.get_labels()},
)
)
)
if not has_pr:
author = Author(commit.author.login, commit.author.html_url) if commit.author else None
changelog_items.add(
Expand Down

0 comments on commit 4394c4e

Please sign in to comment.