MCPcopy Create free account
hub / github.com/cli/cli / getWorkflowByID

Function getWorkflowByID

pkg/cmd/workflow/shared/shared.go:164–176  ·  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

162
163// ID can be either a numeric database ID or the workflow file name
164func getWorkflowByID(client *api.Client, repo ghrepo.Interface, ID string) (*Workflow, error) {
165 var workflow Workflow
166
167 path, err := safeurl.JoinPath("repos", repo.RepoOwner(), repo.RepoName(), "actions", "workflows", ID)
168 if err != nil {
169 return nil, err
170 }
171 if err := client.REST(repo.RepoHost(), "GET", path.String(), nil, &workflow); err != nil {
172 return nil, err
173 }
174
175 return &workflow, nil
176}
177
178func getWorkflowsByName(client *api.Client, repo ghrepo.Interface, name string, states []WorkflowState) ([]Workflow, error) {
179 workflows, err := GetWorkflows(client, repo, 0)

Callers 2

FindWorkflowFunction · 0.85
GetWorkflowFunction · 0.85

Calls 6

JoinPathFunction · 0.92
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65
RESTMethod · 0.65
RepoHostMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected