fix(tasks): resolve PR work items upstream-first under 'auto' like issues (#8727)

This commit is contained in:
moseoh
2026-07-23 23:20:52 -07:00
committed by GitHub
parent 91884b6d5f
commit 832aa69ce8
2 changed files with 56 additions and 2 deletions
+4 -2
View File
@@ -1109,8 +1109,10 @@ async function resolvePrWorkItemSource(
getOriginGitHubApiRepository(repoPath, connectionId, localGitOptions),
getGitHubApiRepositoryForRemote(repoPath, 'upstream', connectionId, localGitOptions)
])
const source =
preference === 'upstream' ? (upstreamCandidate ?? originCandidate) : originCandidate
// Why: fork-contribution PRs live on the upstream repo (the fork's own PR
// list is almost always empty), so 'auto' resolves upstream-first exactly
// like the issue side. Only an explicit 'origin' pick pins PRs to the fork.
const source = preference === 'origin' ? originCandidate : (upstreamCandidate ?? originCandidate)
return { source, originCandidate, upstreamCandidate }
}