MCPcopy Index your code
hub / github.com/github/github-mcp-server / handleSingleJobLogs

Function handleSingleJobLogs

pkg/github/actions.go:115–127  ·  view source on GitHub ↗

handleSingleJobLogs gets logs for a single job

(ctx context.Context, client *github.Client, owner, repo string, jobID int64, returnContent bool, tailLines int, contentWindowSize int)

Source from the content-addressed store, hash-verified

113
114// handleSingleJobLogs gets logs for a single job
115func handleSingleJobLogs(ctx context.Context, client *github.Client, owner, repo string, jobID int64, returnContent bool, tailLines int, contentWindowSize int) (*mcp.CallToolResult, any, error) {
116 jobResult, resp, err := getJobLogData(ctx, client, owner, repo, jobID, "", returnContent, tailLines, contentWindowSize)
117 if err != nil {
118 return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to get job logs", resp, err), nil, nil
119 }
120
121 r, err := json.Marshal(jobResult)
122 if err != nil {
123 return nil, nil, fmt.Errorf("failed to marshal response: %w", err)
124 }
125
126 return utils.NewToolResultText(string(r)), nil, nil
127}
128
129// getJobLogData retrieves log data for a single job, either as URL or content
130func getJobLogData(ctx context.Context, client *github.Client, owner, repo string, jobID int64, jobName string, returnContent bool, tailLines int, contentWindowSize int) (map[string]any, *github.Response, error) {

Callers 1

ActionsGetJobLogsFunction · 0.85

Calls 2

NewToolResultTextFunction · 0.92
getJobLogDataFunction · 0.85

Tested by

no test coverage detected