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

Function getExistingSecretsInRepo

pkg/cli/engine_secrets.go:500–526  ·  view source on GitHub ↗

getExistingSecretsInRepo checks which secrets exist in the repository

(repoSlug string)

Source from the content-addressed store, hash-verified

498
499// getExistingSecretsInRepo checks which secrets exist in the repository
500func getExistingSecretsInRepo(repoSlug string) (map[string]struct {
501}, error) {
502 engineSecretsLog.Printf("Checking existing secrets for repo: %s", repoSlug)
503
504 existingSecrets := make(map[string]struct {
505 })
506
507 // List secrets from repository
508 output, err := workflow.RunGHCombined("Checking secrets...", "secret", "list", "--repo", repoSlug)
509 if err != nil {
510 engineSecretsLog.Printf("Could not list secrets for %s: %v", repoSlug, err)
511 return existingSecrets, err
512 }
513
514 // Check for all known engine secrets
515 secretNames := constants.GetAllEngineSecretNames()
516
517 outputStr := string(output)
518 for _, name := range secretNames {
519 if stringContainsSecretName(outputStr, name) {
520 existingSecrets[name] = struct {
521 }{}
522 }
523 }
524
525 return existingSecrets, nil
526}
527
528// GetEngineSecretNameAndValue returns the secret name and value for an engine.
529// It checks if the secret exists in the repository and retrieves the value from environment if needed.

Callers 2

runTokensBootstrapFunction · 0.85
RunWorkflowTrialsFunction · 0.85

Calls 4

RunGHCombinedFunction · 0.92
GetAllEngineSecretNamesFunction · 0.92
stringContainsSecretNameFunction · 0.85
PrintfMethod · 0.45

Tested by

no test coverage detected