diff --git a/.github/workflows/gemini-scheduled-triage.yml b/.github/workflows/gemini-scheduled-triage.yml index 74220029..5c1d8794 100644 --- a/.github/workflows/gemini-scheduled-triage.yml +++ b/.github/workflows/gemini-scheduled-triage.yml @@ -46,10 +46,14 @@ jobs: # GITHUB_TOKEN provided by the action has enough permissions to read # the labels. script: |- - const { data: labels } = await github.rest.issues.listLabelsForRepo({ + const labels = []; + for await (const response of github.paginate.iterator(github.rest.issues.listLabelsForRepo, { owner: context.repo.owner, repo: context.repo.repo, - }); + per_page: 100, // Maximum per page to reduce API calls + })) { + labels.push(...response.data); + } if (!labels || labels.length === 0) { core.setFailed('There are no issue labels in this repository.') diff --git a/.github/workflows/gemini-triage.yml b/.github/workflows/gemini-triage.yml index 0cb82374..1fcf9353 100644 --- a/.github/workflows/gemini-triage.yml +++ b/.github/workflows/gemini-triage.yml @@ -37,10 +37,14 @@ jobs: # GITHUB_TOKEN provided by the action has enough permissions to read # the labels. script: |- - const { data: labels } = await github.rest.issues.listLabelsForRepo({ + const labels = []; + for await (const response of github.paginate.iterator(github.rest.issues.listLabelsForRepo, { owner: context.repo.owner, repo: context.repo.repo, - }); + per_page: 100, // Maximum per page to reduce API calls + })) { + labels.push(...response.data); + } if (!labels || labels.length === 0) { core.setFailed('There are no issue labels in this repository.') diff --git a/examples/workflows/issue-triage/gemini-scheduled-triage.yml b/examples/workflows/issue-triage/gemini-scheduled-triage.yml index 9487525b..9e52ad70 100644 --- a/examples/workflows/issue-triage/gemini-scheduled-triage.yml +++ b/examples/workflows/issue-triage/gemini-scheduled-triage.yml @@ -46,10 +46,14 @@ jobs: # GITHUB_TOKEN provided by the action has enough permissions to read # the labels. script: |- - const { data: labels } = await github.rest.issues.listLabelsForRepo({ + const labels = []; + for await (const response of github.paginate.iterator(github.rest.issues.listLabelsForRepo, { owner: context.repo.owner, repo: context.repo.repo, - }); + per_page: 100, // Maximum per page to reduce API calls + })) { + labels.push(...response.data); + } if (!labels || labels.length === 0) { core.setFailed('There are no issue labels in this repository.') diff --git a/examples/workflows/issue-triage/gemini-triage.yml b/examples/workflows/issue-triage/gemini-triage.yml index 20edfe2d..5172111e 100644 --- a/examples/workflows/issue-triage/gemini-triage.yml +++ b/examples/workflows/issue-triage/gemini-triage.yml @@ -37,10 +37,14 @@ jobs: # GITHUB_TOKEN provided by the action has enough permissions to read # the labels. script: |- - const { data: labels } = await github.rest.issues.listLabelsForRepo({ + const labels = []; + for await (const response of github.paginate.iterator(github.rest.issues.listLabelsForRepo, { owner: context.repo.owner, repo: context.repo.repo, - }); + per_page: 100, // Maximum per page to reduce API calls + })) { + labels.push(...response.data); + } if (!labels || labels.length === 0) { core.setFailed('There are no issue labels in this repository.')