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

Function rerunFailedJobs

pkg/github/actions.go:1081–1101  ·  view source on GitHub ↗
(ctx context.Context, client *github.Client, owner, repo string, runID int64)

Source from the content-addressed store, hash-verified

1079}
1080
1081func rerunFailedJobs(ctx context.Context, client *github.Client, owner, repo string, runID int64) (*mcp.CallToolResult, any, error) {
1082 resp, err := client.Actions.RerunFailedJobsByID(ctx, owner, repo, runID)
1083 if err != nil {
1084 return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to rerun failed jobs", resp, err), nil, nil
1085 }
1086 defer func() { _ = resp.Body.Close() }()
1087
1088 result := map[string]any{
1089 "message": "Failed jobs have been queued for re-run",
1090 "run_id": runID,
1091 "status": resp.Status,
1092 "status_code": resp.StatusCode,
1093 }
1094
1095 r, err := json.Marshal(result)
1096 if err != nil {
1097 return nil, nil, fmt.Errorf("failed to marshal response: %w", err)
1098 }
1099
1100 return utils.NewToolResultText(string(r)), nil, nil
1101}
1102
1103func cancelWorkflowRun(ctx context.Context, client *github.Client, owner, repo string, runID int64) (*mcp.CallToolResult, any, error) {
1104 resp, err := client.Actions.CancelWorkflowRunByID(ctx, owner, repo, runID)

Callers 1

ActionsRunTriggerFunction · 0.85

Calls 2

NewToolResultTextFunction · 0.92
CloseMethod · 0.80

Tested by

no test coverage detected