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

Function copilotRequestsPermissionPresentInLines

pkg/cli/add_command.go:930–938  ·  view source on GitHub ↗

copilotRequestsPermissionPresentInLines returns true when the frontmatter lines contain a `copilot-requests:` key (ignoring comment lines). It is used to distinguish the idempotent case (permission already present) from the injection-failure case (scalar permissions field).

(lines []string)

Source from the content-addressed store, hash-verified

928// a `copilot-requests:` key (ignoring comment lines). It is used to distinguish the idempotent
929// case (permission already present) from the injection-failure case (scalar permissions field).
930func copilotRequestsPermissionPresentInLines(lines []string) bool {
931 for _, line := range lines {
932 trimmed := strings.TrimSpace(line)
933 if !strings.HasPrefix(trimmed, "#") && parseYAMLMapKey(trimmed) == "copilot-requests" {
934 return true
935 }
936 }
937 return false
938}

Callers 1

Calls 1

parseYAMLMapKeyFunction · 0.85

Tested by

no test coverage detected