ID can be either a numeric database ID or the workflow file name
(client *api.Client, repo ghrepo.Interface, ID string)
| 157 | |
| 158 | // ID can be either a numeric database ID or the workflow file name |
| 159 | func 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 | |
| 170 | func getWorkflowsByName(client *api.Client, repo ghrepo.Interface, name string, states []WorkflowState) ([]Workflow, error) { |
| 171 | workflows, err := GetWorkflows(client, repo, 0) |
no test coverage detected