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

Function parseSecretNames

pkg/cli/add_interactive_secrets.go:62–72  ·  view source on GitHub ↗

parseSecretNames parses newline-delimited GitHub API output and returns the non-empty, trimmed secret names.

(output []byte)

Source from the content-addressed store, hash-verified

60// parseSecretNames parses newline-delimited GitHub API output and returns the
61// non-empty, trimmed secret names.
62func parseSecretNames(output []byte) []string {
63 trimmed := strings.TrimSpace(string(output))
64 if trimmed == "" {
65 return nil
66 }
67 lines := strings.Split(trimmed, "\n")
68 return sliceutil.Filter(
69 sliceutil.Map(lines, strings.TrimSpace),
70 func(name string) bool { return name != "" },
71 )
72}
73
74// resolveEngineApiKeyCredential returns the secret name and value based on the selected engine
75// Returns empty value if the secret already exists in the repository

Callers 2

TestParseSecretNamesFunction · 0.85
checkExistingSecretsMethod · 0.85

Calls 2

FilterFunction · 0.92
MapFunction · 0.92

Tested by 1

TestParseSecretNamesFunction · 0.68