MCPcopy
hub / github.com/cli/cli / getWorkflowByID

Function getWorkflowByID

pkg/cmd/workflow/shared/shared.go:159–168  ·  view source on GitHub ↗

ID can be either a numeric database ID or the workflow file name

(client *api.Client, repo ghrepo.Interface, ID string)

Source from the content-addressed store, hash-verified

157
158// ID can be either a numeric database ID or the workflow file name
159func getWorkflowByID(client *api.Client, repo ghrepo.Interface, ID string) (*Workflow, error) {
160 var workflow Workflow
161
162 path := fmt.Sprintf("repos/%s/actions/workflows/%s", ghrepo.FullName(repo), url.PathEscape(ID))
163 if err := client.REST(repo.RepoHost(), "GET", path, nil, &workflow); err != nil {
164 return nil, err
165 }
166
167 return &workflow, nil
168}
169
170func getWorkflowsByName(client *api.Client, repo ghrepo.Interface, name string, states []WorkflowState) ([]Workflow, error) {
171 workflows, err := GetWorkflows(client, repo, 0)

Callers 2

FindWorkflowFunction · 0.85
GetWorkflowFunction · 0.85

Calls 3

FullNameFunction · 0.92
RESTMethod · 0.65
RepoHostMethod · 0.65

Tested by

no test coverage detected