Skip to content

Commit cd73b32

Browse files
authored
Use the paginate API call to get all runners instead of just the first page. (machulav#51)
1 parent 21b339b commit cd73b32

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/gh.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ async function getRunner(label) {
99
const octokit = github.getOctokit(config.input.githubToken);
1010

1111
try {
12-
const response = await octokit.request('GET /repos/{owner}/{repo}/actions/runners', config.githubContext);
13-
const foundRunners = _.filter(response.data.runners, { labels: [{ name: label }] });
12+
const runners = await octokit.paginate('GET /repos/{owner}/{repo}/actions/runners', config.githubContext);
13+
const foundRunners = _.filter(runners, { labels: [{ name: label }] });
1414
return foundRunners.length > 0 ? foundRunners[0] : null;
1515
} catch (error) {
1616
return null;

0 commit comments

Comments
 (0)