Skip to content

fix(github): Include owner in head parameter for PRs from forks #8313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025

Conversation

matthewevans
Copy link
Contributor

Creating Pull Requests from a fork to an upstream repository failed with a GitHub API error: {"resource":"PullRequest","field":"head","code":"invalid"}.

🧢 Changes

  • Updated GitHubPrService.createPr to accept the fork owner (headOwner) and format the head parameter as owner:branch.
  • Modified ReviewCreation.svelte to use the existing parseRemoteUrl utility to extract the owner from the project's Git URL and pass it to createPr.

☕️ Reasoning

The API call was missing the required owner: prefix in the head parameter when the source branch exists on a fork.

Copy link

vercel bot commented Apr 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitbutler-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2025 3:51pm

Copy link

vercel bot commented Apr 28, 2025

@matthewevans is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

@Byron
Copy link
Collaborator

Byron commented Apr 29, 2025

Thanks for tackling this - it's interesting that this issue didn't show up before.

The implementation looks good to me, but I didn't run it and @estib-vega would definitely know more.

Copy link
Member

@krlvi krlvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Matt!

@krlvi krlvi merged commit 4f54f9b into gitbutlerapp:master Apr 30, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants