Merge 3d67517f3e into ae614d919f
commit
18beca1968
|
|
@ -94,7 +94,7 @@ type GitHubPullRequest = {
|
|||
}
|
||||
headRepository: {
|
||||
nameWithOwner: string
|
||||
}
|
||||
} | null
|
||||
commits: {
|
||||
totalCount: number
|
||||
nodes: Array<{
|
||||
|
|
@ -607,7 +607,7 @@ export const GithubRunCommand = cmd({
|
|||
) {
|
||||
const prData = await fetchPR()
|
||||
// Local PR
|
||||
if (prData.headRepository.nameWithOwner === prData.baseRepository.nameWithOwner) {
|
||||
if (prData.headRepository?.nameWithOwner === prData.baseRepository.nameWithOwner) {
|
||||
await checkoutLocalBranch(prData)
|
||||
const head = await gitText(["rev-parse", "HEAD"])
|
||||
const dataPrompt = buildPromptDataForPR(prData)
|
||||
|
|
@ -1109,6 +1109,10 @@ export const GithubRunCommand = cmd({
|
|||
async function checkoutForkBranch(pr: GitHubPullRequest) {
|
||||
console.log("Checking out fork branch...")
|
||||
|
||||
if (!pr.headRepository) {
|
||||
throw new Error("Cannot checkout fork branch: the source repository has been deleted or is inaccessible")
|
||||
}
|
||||
|
||||
const remoteBranch = pr.headRefName
|
||||
const localBranch = generateBranchName("pr")
|
||||
const depth = Math.max(pr.commits.totalCount, 20)
|
||||
|
|
|
|||
Loading…
Reference in New Issue