MCPcopy Create free account
hub / github.com/github/gh-aw / extractCurrentPullRequestUpdateState

Function extractCurrentPullRequestUpdateState

pkg/cli/outcome_eval_update.go:235–251  ·  view source on GitHub ↗
(repo string, number int)

Source from the content-addressed store, hash-verified

233}
234
235func extractCurrentPullRequestUpdateState(repo string, number int) (map[string]any, bool, error) {
236 pullRequest, err := outcomeUpdateGHAPIGet(fmt.Sprintf("pulls/%d", number), repo)
237 if err != nil {
238 return nil, false, err
239 }
240 base, _ := pullRequest["base"].(map[string]any)
241 head, _ := pullRequest["head"].(map[string]any)
242 merged, _ := pullRequest["merged"].(bool)
243 return map[string]any{
244 "title": mutableString(pullRequest["title"]),
245 "body_hash": mutableBodyHash(pullRequest["body"]),
246 "state": mutableString(pullRequest["state"]),
247 "base": mutableString(base["ref"]),
248 "draft": mutableBool(pullRequest["draft"]),
249 "head_sha": mutableString(head["sha"]),
250 }, merged, nil
251}
252
253func extractNamedItems(raw any, key string) []string {
254 items, _ := raw.([]any)

Callers

nothing calls this directly

Calls 3

mutableStringFunction · 0.85
mutableBodyHashFunction · 0.85
mutableBoolFunction · 0.85

Tested by

no test coverage detected