Skip to content

Commit f28ce77

Browse files
authored
Merge pull request #266 from Alynva/patch-1
Update getAllGithubLabelNames to paginate label retrieval
2 parents d272279 + 962e94b commit f28ce77

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/githubHelper.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,16 @@ export class GithubHelper {
241241
try {
242242
await utils.sleep(this.delayInMs);
243243
// get an array of GitHub labels for the new repo
244-
let result = await this.githubApi.issues.listLabelsForRepo({
245-
owner: this.githubOwner,
246-
repo: this.githubRepo,
247-
});
248-
249-
// extract the label name and put into a new array
250-
let labels = result.data.map(x => x.name);
244+
const labels = await this.githubApi.paginate(
245+
this.githubApi.issues.listLabelsForRepo,
246+
{
247+
owner: this.githubOwner,
248+
repo: this.githubRepo,
249+
per_page: 100,
250+
},
251+
// extract the label name and put into a new array
252+
response => response.data.map(label => label.name)
253+
);
251254

252255
return labels;
253256
} catch (err) {

0 commit comments

Comments
 (0)