Skip to content

Commit e81e009

Browse files
authored
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
1 parent 5c11dc7 commit e81e009

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/github-helper.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,13 @@ export class GitHubHelper {
189189
workflowName: string
190190
): Promise<string> {
191191
core.debug(`Getting workflow ${workflowName} for repository ${repository}`)
192-
const {data: workflows} = await this.octokit.rest.actions.listRepoWorkflows(
192+
const workflows = await this.octokit.paginate("GET /repos/{owner}/{repo}/actions/workflows",
193193
{
194-
...this.parseRepository(repository)
194+
...this.parseRepository(repository),
195+
per_page: 100
195196
}
196197
)
197-
for (const workflow of workflows.workflows) {
198+
for (const workflow of workflows) {
198199
core.debug(`Found workflow: ${workflow.path}`)
199200
if (
200201
workflow.path.endsWith(`${workflowName}.yml`) ||

0 commit comments

Comments
 (0)