(params map[string]interface{})
| 200 | return simplifyIssueList(result) |
| 201 | } |
| 202 | func (g *githubTools) createIssue(params map[string]interface{}) (string, error) { |
| 203 | owner, _ := params["owner"].(string) |
| 204 | repo, _ := params["repo"].(string) |
| 205 | title, _ := params["title"].(string) |
| 206 | if owner == "" || repo == "" || title == "" { |
| 207 | return "", fmt.Errorf("github_create_issue: 'owner', 'repo', and 'title' params required") |
| 208 | } |
| 209 | |
| 210 | if g.token == "" { |
| 211 | return "", fmt.Errorf("github_create_issue: GITHUB_TOKEN required for write operations") |
| 212 | } |
| 213 | |
| 214 | body := map[string]interface{}{ |
| 215 | "title": title, |
| 216 | } |
| 217 | if b, ok := params["body"].(string); ok { |
| 218 | body["body"] = b |
| 219 | } |
| 220 | if labels, ok := params["labels"]; ok { |
| 221 | body["labels"] = labels |
| 222 | } |
| 223 | |
| 224 | bodyBytes, _ := json.Marshal(body) |
| 225 | |
| 226 | result, err := g.exec.Execute(HTTPToolConfig{ |
| 227 | Method: "POST", |
| 228 | URL: fmt.Sprintf("%s/repos/%s/%s/issues", githubAPI, owner, repo), |
| 229 | Headers: g.headers(), |
| 230 | RawBody: bodyBytes, |
| 231 | }, nil) |
| 232 | if err != nil { |
| 233 | return "", fmt.Errorf("github_create_issue: %w", err) |
| 234 | } |
| 235 | |
| 236 | return simplifyIssue(result) |
| 237 | } |
| 238 | |
| 239 | func (g *githubTools) listPulls(params map[string]interface{}) (string, error) { |
| 240 | owner, _ := params["owner"].(string) |
nothing calls this directly
no test coverage detected