From fbcce33f1b391e7acfc47e57a14caff08e14cfe2 Mon Sep 17 00:00:00 2001 From: Rahul Gautam Singh Date: Sun, 29 Dec 2024 02:36:22 +0530 Subject: [PATCH 1/2] github(findPr): fix url --- lib/modules/platform/github/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts index 1298d0f908f04c..93488565ba630a 100644 --- a/lib/modules/platform/github/index.ts +++ b/lib/modules/platform/github/index.ts @@ -855,9 +855,10 @@ export async function findPr({ if (includeOtherAuthors) { const repo = config.parentRepo ?? config.repository; + const org = repo?.split('/')[0]; // PR might have been created by anyone, so don't use the cached Renovate PR list const { body: prList } = await githubApi.getJson( - `repos/${repo}/pulls?head=${repo}:${branchName}&state=open`, + `repos/${repo}/pulls?head=${org}:${branchName}&state=open`, { cacheProvider: repoCacheProvider }, ); From 8ece9606458f195c05c2f861045380b41b695bf5 Mon Sep 17 00:00:00 2001 From: Rahul Gautam Singh Date: Sun, 29 Dec 2024 02:57:44 +0530 Subject: [PATCH 2/2] update tests --- lib/modules/platform/github/index.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modules/platform/github/index.spec.ts b/lib/modules/platform/github/index.spec.ts index e16f3db73b860f..eb133f6ecae99b 100644 --- a/lib/modules/platform/github/index.spec.ts +++ b/lib/modules/platform/github/index.spec.ts @@ -2568,7 +2568,7 @@ describe('modules/platform/github/index', () => { const scope = httpMock.scope(githubApiHost); initRepoMock(scope, 'some/repo'); scope - .get('/repos/some/repo/pulls?head=some/repo:branch&state=open') + .get('/repos/some/repo/pulls?head=some:branch&state=open') .reply(200, [ { number: 1, @@ -2598,7 +2598,7 @@ describe('modules/platform/github/index', () => { const scope = httpMock.scope(githubApiHost); initRepoMock(scope, 'some/repo'); scope - .get('/repos/some/repo/pulls?head=some/repo:branch&state=open') + .get('/repos/some/repo/pulls?head=some:branch&state=open') .reply(200, []); await github.initRepo({ repository: 'some/repo' }); const pr = await github.findPr({