Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions examples/workflows/issue-triage/gemini-scheduled-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down
8 changes: 6 additions & 2 deletions examples/workflows/issue-triage/gemini-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down
Loading