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

Function stringContainsSecretName

pkg/cli/engine_secrets.go:487–497  ·  view source on GitHub ↗

stringContainsSecretName checks if the gh secret list output contains a secret name

(output, secretName string)

Source from the content-addressed store, hash-verified

485
486// stringContainsSecretName checks if the gh secret list output contains a secret name
487func stringContainsSecretName(output, secretName string) bool {
488 lines := strings.SplitSeq(output, "\n")
489 for line := range lines {
490 if len(line) >= len(secretName) {
491 if line[:len(secretName)] == secretName && (len(line) == len(secretName) || line[len(secretName)] == '\t' || line[len(secretName)] == ' ') {
492 return true
493 }
494 }
495 }
496 return false
497}
498
499// getExistingSecretsInRepo checks which secrets exist in the repository
500func getExistingSecretsInRepo(repoSlug string) (map[string]struct {

Callers 3

uploadSecretToRepoFunction · 0.85
getExistingSecretsInRepoFunction · 0.85

Calls

no outgoing calls

Tested by 1