forked from mirrors/probot
refactor: use the new github.paginate syntax
This commit is contained in:
parent
6dc8dccdf8
commit
624bae2d61
|
@ -39,8 +39,7 @@ export = async (app: Application): Promise<void> => {
|
|||
async function getInstallations (): Promise<Installation[]> {
|
||||
const github = await app.auth()
|
||||
|
||||
const req = github.apps.listInstallations({ per_page: 100 })
|
||||
return github.paginate(req, (response: AnyResponse) => {
|
||||
return github.paginate(github.apps.listInstallations.endpoint.merge({ per_page: 100 }), (response: AnyResponse) => {
|
||||
return response.data
|
||||
})
|
||||
}
|
||||
|
@ -57,8 +56,7 @@ export = async (app: Application): Promise<void> => {
|
|||
|
||||
const github = await app.auth(installation.id)
|
||||
|
||||
const req = github.apps.listRepos({ per_page: 100 })
|
||||
const repositories: Repository[] = await github.paginate(req, (response: AnyResponse) => {
|
||||
const repositories: Repository[] = await github.paginate(github.apps.listRepos.endpoint.merge({ per_page: 100 }), (response: AnyResponse) => {
|
||||
return response.data.repositories.filter((repository: Repository) => !repository.private)
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue