(ctx context.Context, client *github.Client, owner, repo string, pagination PaginationParams)
| 823 | } |
| 824 | |
| 825 | func listWorkflows(ctx context.Context, client *github.Client, owner, repo string, pagination PaginationParams) (*mcp.CallToolResult, any, error) { |
| 826 | opts := &github.ListOptions{ |
| 827 | PerPage: pagination.PerPage, |
| 828 | Page: pagination.Page, |
| 829 | } |
| 830 | |
| 831 | workflows, resp, err := client.Actions.ListWorkflows(ctx, owner, repo, opts) |
| 832 | if err != nil { |
| 833 | return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to list workflows", resp, err), nil, nil |
| 834 | } |
| 835 | defer func() { _ = resp.Body.Close() }() |
| 836 | |
| 837 | r, err := json.Marshal(workflows) |
| 838 | if err != nil { |
| 839 | return nil, nil, fmt.Errorf("failed to marshal workflows: %w", err) |
| 840 | } |
| 841 | |
| 842 | return utils.NewToolResultText(string(r)), nil, nil |
| 843 | } |
| 844 | |
| 845 | func listWorkflowRuns(ctx context.Context, client *github.Client, args map[string]any, owner, repo, resourceID string, pagination PaginationParams) (*mcp.CallToolResult, any, error) { |
| 846 | filterArgs, err := OptionalParam[map[string]any](args, "workflow_runs_filter") |
no test coverage detected