Skip to content

Commit

Permalink
fix(platform/github): use correct url to find pr when only using bran…
Browse files Browse the repository at this point in the history
…ch name (#33324)
  • Loading branch information
RahulGautamSingh authored Dec 29, 2024
1 parent a4042bb commit a42069d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/modules/platform/github/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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({
Expand Down
3 changes: 2 additions & 1 deletion lib/modules/platform/github/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<GhRestPr[]>(
`repos/${repo}/pulls?head=${repo}:${branchName}&state=open`,
`repos/${repo}/pulls?head=${org}:${branchName}&state=open`,
{ cacheProvider: repoCacheProvider },
);

Expand Down

0 comments on commit a42069d

Please sign in to comment.