Skip to content

Commit

Permalink
Cherry-pick 277008@main (a1f01fd). rdar://125792901
Browse files Browse the repository at this point in the history
    Github api should not assume the current user as the fork owner.
    https://bugs.webkit.org/show_bug.cgi?id=272054
    rdar://125792901 (Github api should not assume the current user as the fork owner)

    Reviewed by Jonathan Bedard.

    Canonical link: https://commits.webkit.org/277008@main

Canonical link: https://commits.webkit.org/272448.902@safari-7618-branch
  • Loading branch information
akath20 authored and JonWBedard committed Apr 10, 2024
1 parent f35591c commit 907ee0e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def create(self, head, title, body=None, commits=None, base=None, draft=None):
if not value:
raise ValueError("Must define '{}' when creating pull-request".format(key))

user, _ = self.repository.credentials(required=True)
if ':' not in head:
user, _ = self.repository.credentials(required=True)
head = '{}:{}'.format(user, head)
url = '{api_url}/repos/{owner}/{name}/pulls'.format(
api_url=self.repository.api_url,
owner=self.repository.owner,
Expand All @@ -152,7 +154,7 @@ def create(self, head, title, body=None, commits=None, base=None, draft=None):
title=title,
body=PullRequest.create_body(body, commits),
base=base or self.repository.default_branch,
head='{}:{}'.format(user, head),
head=head,
draft=draft,
),
)
Expand Down

0 comments on commit 907ee0e

Please sign in to comment.