MCPcopy
hub / github.com/github/github-mcp-server / listWorkflowArtifacts

Function listWorkflowArtifacts

pkg/github/actions.go:934–952  ·  view source on GitHub ↗
(ctx context.Context, client *github.Client, owner, repo string, resourceID int64, pagination PaginationParams)

Source from the content-addressed store, hash-verified

932}
933
934func listWorkflowArtifacts(ctx context.Context, client *github.Client, owner, repo string, resourceID int64, pagination PaginationParams) (*mcp.CallToolResult, any, error) {
935 opts := &github.ListOptions{
936 PerPage: pagination.PerPage,
937 Page: pagination.Page,
938 }
939
940 artifacts, resp, err := client.Actions.ListWorkflowRunArtifacts(ctx, owner, repo, resourceID, opts)
941 if err != nil {
942 return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to list workflow run artifacts", resp, err), nil, nil
943 }
944 defer func() { _ = resp.Body.Close() }()
945
946 r, err := json.Marshal(artifacts)
947 if err != nil {
948 return nil, nil, fmt.Errorf("failed to marshal response: %w", err)
949 }
950
951 return utils.NewToolResultText(string(r)), nil, nil
952}
953
954func downloadWorkflowArtifact(ctx context.Context, client *github.Client, owner, repo string, resourceID int64) (*mcp.CallToolResult, any, error) {
955 // Get the download URL for the artifact

Callers 1

ActionsListFunction · 0.85

Calls 2

NewToolResultTextFunction · 0.92
CloseMethod · 0.80

Tested by

no test coverage detected