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

Function getWorkflowByID

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

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