(httpClient *http.Client, id string, repo ghrepo.Interface, labels []string)
| 150 | } |
| 151 | |
| 152 | func addLabels(httpClient *http.Client, id string, repo ghrepo.Interface, labels []string) error { |
| 153 | params := githubv4.AddLabelsToLabelableInput{ |
| 154 | LabelableID: id, |
| 155 | LabelIDs: *ghIds(&labels), |
| 156 | } |
| 157 | |
| 158 | var mutation struct { |
| 159 | AddLabelsToLabelable struct { |
| 160 | Typename string `graphql:"__typename"` |
| 161 | } `graphql:"addLabelsToLabelable(input: $input)"` |
| 162 | } |
| 163 | |
| 164 | variables := map[string]interface{}{"input": params} |
| 165 | gql := api.NewClientFromHTTP(httpClient) |
| 166 | return gql.Mutate(repo.RepoHost(), "LabelAdd", &mutation, variables) |
| 167 | } |
| 168 | |
| 169 | func removeLabels(httpClient *http.Client, id string, repo ghrepo.Interface, labels []string) error { |
| 170 | params := githubv4.RemoveLabelsFromLabelableInput{ |
no test coverage detected