From e81e009bcec84286d1cdc99efb8445bf717923b7 Mon Sep 17 00:00:00 2001 From: Jesus Aguilera Date: Thu, 18 Dec 2025 08:34:32 -0800 Subject: [PATCH 1/2] fix: paginate workflow discovery for repos with >30 workflows in workflow_dispatch commands (#437) * Fetch all workflows with paginate * Add page parameter when fetching all workflows --- src/github-helper.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/github-helper.ts b/src/github-helper.ts index 3528aed4c..c3d4215da 100644 --- a/src/github-helper.ts +++ b/src/github-helper.ts @@ -189,12 +189,13 @@ export class GitHubHelper { workflowName: string ): Promise { core.debug(`Getting workflow ${workflowName} for repository ${repository}`) - const {data: workflows} = await this.octokit.rest.actions.listRepoWorkflows( + const workflows = await this.octokit.paginate("GET /repos/{owner}/{repo}/actions/workflows", { - ...this.parseRepository(repository) + ...this.parseRepository(repository), + per_page: 100 } ) - for (const workflow of workflows.workflows) { + for (const workflow of workflows) { core.debug(`Found workflow: ${workflow.path}`) if ( workflow.path.endsWith(`${workflowName}.yml`) || From 5810aafa29960e19fae57a5a823b75e26b191a09 Mon Sep 17 00:00:00 2001 From: Peter Evans <18365890+peter-evans@users.noreply.github.com> Date: Thu, 18 Dec 2025 16:50:03 +0000 Subject: [PATCH 2/2] fix: formatting and dist --- dist/index.js | 4 ++-- src/github-helper.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0f45306cb..724925195 100644 --- a/dist/index.js +++ b/dist/index.js @@ -391,8 +391,8 @@ class GitHubHelper { getWorkflow(repository, workflowName) { return __awaiter(this, void 0, void 0, function* () { core.debug(`Getting workflow ${workflowName} for repository ${repository}`); - const { data: workflows } = yield this.octokit.rest.actions.listRepoWorkflows(Object.assign({}, this.parseRepository(repository))); - for (const workflow of workflows.workflows) { + const workflows = yield this.octokit.paginate('GET /repos/{owner}/{repo}/actions/workflows', Object.assign(Object.assign({}, this.parseRepository(repository)), { per_page: 100 })); + for (const workflow of workflows) { core.debug(`Found workflow: ${workflow.path}`); if (workflow.path.endsWith(`${workflowName}.yml`) || workflow.path.endsWith(`${workflowName}.yaml`)) { diff --git a/src/github-helper.ts b/src/github-helper.ts index c3d4215da..24192ab3c 100644 --- a/src/github-helper.ts +++ b/src/github-helper.ts @@ -189,7 +189,8 @@ export class GitHubHelper { workflowName: string ): Promise { core.debug(`Getting workflow ${workflowName} for repository ${repository}`) - const workflows = await this.octokit.paginate("GET /repos/{owner}/{repo}/actions/workflows", + const workflows = await this.octokit.paginate( + 'GET /repos/{owner}/{repo}/actions/workflows', { ...this.parseRepository(repository), per_page: 100