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

Function rerunWorkflowRun

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

Source from the content-addressed store, hash-verified

1057}
1058
1059func rerunWorkflowRun(ctx context.Context, client *github.Client, owner, repo string, runID int64) (*mcp.CallToolResult, any, error) {
1060 resp, err := client.Actions.RerunWorkflowByID(ctx, owner, repo, runID)
1061 if err != nil {
1062 return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to rerun workflow run", resp, err), nil, nil
1063 }
1064 defer func() { _ = resp.Body.Close() }()
1065
1066 result := map[string]any{
1067 "message": "Workflow run has been queued for re-run",
1068 "run_id": runID,
1069 "status": resp.Status,
1070 "status_code": resp.StatusCode,
1071 }
1072
1073 r, err := json.Marshal(result)
1074 if err != nil {
1075 return nil, nil, fmt.Errorf("failed to marshal response: %w", err)
1076 }
1077
1078 return utils.NewToolResultText(string(r)), nil, nil
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)

Callers 1

ActionsRunTriggerFunction · 0.85

Calls 2

NewToolResultTextFunction · 0.92
CloseMethod · 0.80

Tested by

no test coverage detected