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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion apps/desktop/src/components/ReviewCreation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
import { StackPublishingService } from '$lib/history/stackPublishingService';
import { showError, showToast } from '$lib/notifications/toasts';
import { ProjectsService } from '$lib/project/projectsService';
import { RemotesService } from '$lib/remotes/remotesService';
import { StackService } from '$lib/stacks/stackService.svelte';
import { parseRemoteUrl } from '$lib/url/gitUrl';
import { UserService } from '$lib/user/userService';
import { getBranchNameFromRef } from '$lib/utils/branch';
import { sleep } from '$lib/utils/sleep';
Expand Down Expand Up @@ -63,6 +65,7 @@
const userService = getContext(UserService);
const templateService = getContext(TemplateService);
const aiService = getContext(AIService);
const remotesService = getContext(RemotesService);

const user = userService.user;
const project = projectsService.getProjectStore(projectId);
Expand Down Expand Up @@ -276,12 +279,23 @@
base = branchParent.name;
}

const pushRemoteName = baseBranch.actualPushRemoteName();
const allRemotes = await remotesService.remotes(projectId);
const pushRemote = allRemotes.find((r) => r.name === pushRemoteName);
const pushRemoteUrl = pushRemote?.url;

const repoInfo = parseRemoteUrl(pushRemoteUrl);

const upstreamName = repoInfo?.owner
? `${repoInfo.owner}:${params.upstreamBranchName}`
: params.upstreamBranchName;

const pr = await prService.createPr({
title: params.title,
body: params.body,
draft: params.draft,
baseBranchName: base,
upstreamName: params.upstreamBranchName
upstreamName
});

// Store the new pull request number with the branch data.
Expand Down
Loading