ID can be either a numeric database ID or the workflow file name
(client *api.Client, repo ghrepo.Interface, ID string)
| 160 | |
| 161 | // ID can be either a numeric database ID or the workflow file name |
| 162 | func 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 | |
| 176 | func getWorkflowsByName(client *api.Client, repo ghrepo.Interface, name string, states []WorkflowState) ([]Workflow, error) { |
| 177 | workflows, err := GetWorkflows(client, repo, 0) |