Make PRInfo.compare_pr_url persistent for the Github.PullReaquest objects

This commit is contained in:
Mikhail f. Shiryaev 2024-06-06 13:09:54 +02:00
parent 8ebcd88608
commit 3b593a7c5e
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -266,12 +266,12 @@ class PRInfo:
self.diff_urls.append(
self.compare_url(
pull_request["base"]["repo"]["default_branch"],
pull_request["head"]["label"],
pull_request["head"]["sha"],
)
)
self.diff_urls.append(
self.compare_url(
pull_request["head"]["label"],
pull_request["head"]["sha"],
pull_request["base"]["repo"]["default_branch"],
)
)
@ -286,7 +286,7 @@ class PRInfo:
# itself, but as well files changed since we branched out
self.diff_urls.append(
self.compare_url(
pull_request["head"]["label"],
pull_request["head"]["sha"],
pull_request["base"]["repo"]["default_branch"],
)
)
@ -339,7 +339,7 @@ class PRInfo:
return self.event_type == EventType.DISPATCH
def compare_pr_url(self, pr_object: dict) -> str:
return self.compare_url(pr_object["base"]["label"], pr_object["head"]["label"])
return self.compare_url(pr_object["base"]["sha"], pr_object["head"]["sha"])
@staticmethod
def compare_url(first: str, second: str) -> str: