stringContainsSecretName checks if the gh secret list output contains a secret name
(output, secretName string)
| 485 | |
| 486 | // stringContainsSecretName checks if the gh secret list output contains a secret name |
| 487 | func 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 |
| 500 | func getExistingSecretsInRepo(repoSlug string) (map[string]struct { |
no outgoing calls