Skip to content

Commit

Permalink
Add Pagination for Workflows (#12)
Browse files Browse the repository at this point in the history
* add workflow pagination

* increase workflow page size
  • Loading branch information
domi2120 authored Feb 15, 2024
1 parent 520a673 commit aa765a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ async function run(): Promise<void> {
const repository: string = process.env.GITHUB_REPOSITORY as string;
const [owner, repo] = repository.split("/");

const workflows = await octokit.rest.actions.listRepoWorkflows({ owner, repo });
const workflowId = workflows.data.workflows.find(w => w.name.toLowerCase() === inputs.workflow.toLowerCase())?.id;
const workflows = await octokit.paginate(octokit.rest.actions.listRepoWorkflows, { owner, repo, per_page: 100});
const workflowId = workflows.find(w => w.name.toLowerCase() === inputs.workflow.toLowerCase())?.id;

if (!workflowId) {
core.setFailed(`No workflow exists with the name "${inputs.workflow}"`);
Expand Down

0 comments on commit aa765a1

Please sign in to comment.