(ctx context.Context, client *github.Client, owner, repo string, resourceID int64)
| 797 | } |
| 798 | |
| 799 | func getWorkflowRun(ctx context.Context, client *github.Client, owner, repo string, resourceID int64) (*mcp.CallToolResult, any, error) { |
| 800 | workflowRun, resp, err := client.Actions.GetWorkflowRunByID(ctx, owner, repo, resourceID) |
| 801 | if err != nil { |
| 802 | return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to get workflow run", resp, err), nil, nil |
| 803 | } |
| 804 | defer func() { _ = resp.Body.Close() }() |
| 805 | r, err := json.Marshal(workflowRun) |
| 806 | if err != nil { |
| 807 | return nil, nil, fmt.Errorf("failed to marshal workflow run: %w", err) |
| 808 | } |
| 809 | return utils.NewToolResultText(string(r)), nil, nil |
| 810 | } |
| 811 | |
| 812 | func getWorkflowJob(ctx context.Context, client *github.Client, owner, repo string, resourceID int64) (*mcp.CallToolResult, any, error) { |
| 813 | workflowJob, resp, err := client.Actions.GetWorkflowJobByID(ctx, owner, repo, resourceID) |
no test coverage detected