Skip to content

Commit

Permalink
Merge pull request #575 from camptocamp/changelog-dont-stoll-pullrequest
Browse files Browse the repository at this point in the history
Don't steal pull request
  • Loading branch information
sbrunner authored Oct 28, 2024
2 parents fd0fbcb + 4394c4e commit 8c3bc6b
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 8c3bc6b

Please sign in to comment.