8000 get the response from http request · github/github-mcp-server@f46f435 · GitHub
[go: up one dir, main page]

Skip to content

Commit f46f435

Browse files
get the response from http request
1 parent 8d17eee commit f46f435

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/github/actions.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,10 +736,13 @@ func getJobLogData(ctx context.Context, client *github.Client, owner, repo strin
736736

737737
if returnContent {
738738
// Download and return the actual log content
739-
// TODO we can use a generic http error or an interface instead of github.Response
740-
content, _, err := downloadLogContent(url.String())
739+
content, resp, err := downloadLogContent(url.String())
741740
if err != nil {
742-
return nil, nil, fmt.Errorf("failed to download log content for job %d: %w", jobID, err)
741+
// To keep the return value consistent wrap the response as a GitHub Response
742+
ghRes := &github.Response{
743+
Response: resp,
744+
}
745+
return nil, ghRes, fmt.Errorf("failed to download log content for job %d: %w", jobID, err)
743746
}
744747
result["logs_content"] = content
745748
result["message"] = "Job logs content retrieved successfully"

0 commit comments

Comments
 (0)
0