mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 15:36:25 +00:00
refactor(bitbucket): use paginated api for commit statuses (#22329)
This commit is contained in:
parent
5597560c92
commit
48d4cf3e18
1 changed files with 9 additions and 7 deletions
|
@ -375,13 +375,15 @@ async function getStatus(
|
|||
memCache = true
|
||||
): Promise<BitbucketStatus[]> {
|
||||
const sha = await getBranchCommit(branchName);
|
||||
return utils.accumulateValues<BitbucketStatus>(
|
||||
// TODO: types (#7154)
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
`/2.0/repositories/${config.repository}/commit/${sha}/statuses`,
|
||||
'get',
|
||||
{ memCache }
|
||||
);
|
||||
return (
|
||||
await bitbucketHttp.getJson<PagedResult<BitbucketStatus>>(
|
||||
`/2.0/repositories/${config.repository}/commit/${sha!}/statuses`,
|
||||
{
|
||||
paginate: true,
|
||||
memCache,
|
||||
}
|
||||
)
|
||||
).body.values;
|
||||
}
|
||||
// Returns the combined status for a branch.
|
||||
export async function getBranchStatus(
|
||||
|
|
Loading…
Reference in a new issue