Skip to content
Open

问我 #1107

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions pkg/github/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,35 @@ func handleFailedJobLogs(ctx context.Context, client *github.Client, owner, repo
return nil, fmt.Errorf("failed to marshal response: %w", err)
}

if returnContent {
// return mcp.NewToolResultResource("failed job logs", , nil

Comment on lines +690 to +691
Copy link
Preview

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete commented code should be removed. This appears to be leftover development code that wasn't cleaned up.

Suggested change
// return mcp.NewToolResultResource("failed job logs", , nil

Copilot uses AI. Check for mistakes.

content := []mcp.Content{
mcp.TextContent{
Type: "text",
Text: "Failed job logs for workflow run " + strconv.FormatInt(runID, 10),
}}

for _, jobLog := range logResults {
log, err := json.Marshal(jobLog)
if err != nil {
return nil, fmt.Errorf("failed to marshal job log: %w", err)
}

jobContent := mcp.EmbeddedResource{
Type: "resource",
Resource: mcp.TextResourceContents{
Text: string(log),
MIMEType: "application/json",
URI: "actions://" + owner + "/repo/" + repo + "/jobs/" + strconv.FormatInt(runID, 10) + "/failed_logs/" + strconv.FormatInt(jobLog["job_id"].(int64), 10) + ".json",
},
}
content = append(content, jobContent)
}
return &mcp.CallToolResult{
Content: content,
}, nil
}
return mcp.NewToolResultText(string(r)), nil
}

Expand Down