Skip to content

Commit

Permalink
Merge pull request #6 from druchoo/feature/paginate-org-teams
Browse files Browse the repository at this point in the history
feat: paginate `teams.list` results
  • Loading branch information
skymoore authored Feb 9, 2024
2 parents 501047d + 1f31bda commit ec09d4a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ async function getUserTeams(username, orgName, orgTeams, octokit) {
const teams = [];

for (const team of orgTeams) {
console.log()
const { data: teamMembers } = await octokit.teams.listMembersInOrg({
org: orgName,
team_slug: team.slug,
Expand Down Expand Up @@ -119,7 +118,11 @@ async function main() {
const [owner, repoName] = ghRepo.split("/");
const repo = await octokit.repos.get({ owner, repo: repoName });

const { data: orgTeams } = await readOrgOctokit.teams.list({ org: orgName });
const orgTeams = await readOrgOctokit.paginate(
readOrgOctokit.teams.list,
{ org: orgName },
(response) => response.data
);

let prNumber;
if (process.env["INPUT_BRANCH"] && process.env["INPUT_BRANCH"] !== "") {
Expand Down

0 comments on commit ec09d4a

Please sign in to comment.